/* Radix Colors 3.0.0 supplies the light/dark scales; see vendor/README.md. */
@import url('./vendor/radix-colors/slate.css');
@import url('./vendor/radix-colors/slate-dark.css');
@import url('./vendor/radix-colors/blue.css');
@import url('./vendor/radix-colors/blue-dark.css');
@import url('./vendor/radix-colors/green.css');
@import url('./vendor/radix-colors/green-dark.css');
@import url('./vendor/radix-colors/amber.css');
@import url('./vendor/radix-colors/amber-dark.css');
@import url('./vendor/radix-colors/red.css');
@import url('./vendor/radix-colors/red-dark.css');

#wpPageExportTeamReportBtn[hidden] {
  display: none !important;
}

dialog.notification-history-dialog {
  width: min(640px, calc(100vw - 24px));
  max-width: none;
  max-height: min(85vh, 800px);
  max-height: min(85dvh, 800px);
  overflow: hidden;
  margin: auto;
  padding: 0;
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  color: var(--ui-text);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
}
dialog.notification-history-dialog[open] { display: flex; flex-direction: column; }
.notification-history-dialog::backdrop { background: rgba(15, 23, 42, .55); }
.notification-history-dialog .nh-header, .notification-history-dialog .nh-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; flex-shrink: 0;
  background: var(--ui-surface); color: var(--ui-text); box-shadow: none;
}
.notification-history-dialog .nh-header { border-bottom: 1px solid var(--ui-border); border-radius: 0; }
.notification-history-dialog .nh-title { margin: 0; font-size: 1rem; font-weight: 650; line-height: 1.4; }
.notification-history-dialog .nh-title i { color: var(--ui-text-muted); margin-right: 4px; }
.notification-history-dialog .nh-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.notification-history-dialog :is(.nh-close, .nh-clear) {
  display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px;
  padding: 0; border: 1px solid var(--ui-border); border-radius: 9px; color: var(--ui-text-muted); background: var(--ui-surface-soft); cursor: pointer;
}
.notification-history-dialog .nh-close:hover { color: var(--ui-text); background: var(--ui-surface-hover); }
.notification-history-dialog .nh-clear:hover:not(:disabled) { color: var(--ui-danger); border-color: var(--ui-danger); }
.notification-history-dialog .nh-clear:disabled { opacity: .45; cursor: default; }
.notification-history-dialog .nh-list { overflow-y: auto; min-height: 0; overscroll-behavior: contain; padding: 14px 18px; }
.notification-history-dialog .nh-item { padding: 14px; margin-bottom: 12px; border: 1px solid var(--ui-border); border-radius: 10px; }
.notification-history-dialog .nh-item:last-child { margin-bottom: 0; }
.notification-history-dialog .nh-item.unread { background: var(--ui-accent-soft); }
.notification-history-dialog .nh-item-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.notification-history-dialog .nh-item-title { font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
.notification-history-dialog .nh-unread-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--ui-accent); }
.notification-history-dialog .nh-read-label { color: var(--ui-text-muted); font-size: .75rem; flex-shrink: 0; }
.notification-history-dialog .nh-item-body { margin: 8px 0 12px; font-size: .85rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.notification-history-dialog .nh-item-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.notification-history-dialog :is(.nh-item-time, .nh-action-gone, .nh-hint) { color: var(--ui-text-muted); font-size: .75rem; }
.notification-history-dialog .nh-item-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.notification-history-dialog :is(.nh-action-link, .nh-action-read, .nh-load-more) { font: inherit; font-size: .8rem; cursor: pointer; }
.notification-history-dialog .nh-action-link { border: 0; padding: 6px 0; color: var(--ui-accent); background: transparent; font-weight: 600; }
.notification-history-dialog .nh-action-link:hover { text-decoration: underline; }
.notification-history-dialog :is(.nh-action-read, .nh-load-more) { padding: 6px 10px; color: var(--ui-text-muted); background: transparent; border: 1px solid var(--ui-border); border-radius: 8px; }
.notification-history-dialog :is(.nh-action-read, .nh-load-more):hover { color: var(--ui-text); background: var(--ui-surface-soft); }
.notification-history-dialog .nh-load-more:disabled { opacity: .5; cursor: wait; }
.notification-history-dialog .nh-load-more[hidden] { display: none; }
.notification-history-dialog .nh-footer { border-top: 1px solid var(--ui-border); flex-wrap: wrap; }
.notification-history-dialog button:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 3px; }
#notificationHistoryBtn { margin-left: auto; }
#wpLoadFeedback { align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 480px) {
  .notification-history-dialog :is(.nh-header, .nh-list, .nh-footer) { padding: 12px; }
  .notification-history-dialog .nh-item { padding: 12px; }
  .notification-history-dialog .nh-item-foot { align-items: flex-start; flex-direction: column; gap: 6px; }
  #notificationHistoryBtn { padding: 6px 9px; font-size: .8rem; }
}
@media (pointer: coarse) {
  .notification-history-dialog :is(.nh-close, .nh-clear) { width: 44px; height: 44px; }
  .notification-history-dialog :is(.nh-action-link, .nh-action-read, .nh-load-more) { min-height: 40px; }
}

/* Semantic colors are shared by both themes and retain the legacy aliases. */
:root {
  color-scheme: light dark;
  font-feature-settings: 'tnum' 1, 'cv01' 1;
  --ui-page: #f8fafc;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f1f5f9;
  --ui-surface-hover: #e2e8f0;
  --ui-text: #0f172a;
  --ui-text-muted: #64748b;
  --ui-border: #e2e8f0;
  --ui-border-strong: #cbd5e1;
  --ui-accent: #2563eb;
  --ui-accent-soft: rgba(37, 99, 235, 0.1);
  --ui-focus-ring: rgba(37, 99, 235, 0.35);
  --ui-success: #10b981;
  --ui-warning: #f59e0b;
  --ui-danger: #ef4444;
  --ui-button-bg: #2563eb;
  --ui-button-text: #ffffff;
  --ui-button-hover: #1d4ed8;
  --ui-success-bg: #10b981;
  --ui-success-soft: rgba(16, 185, 129, 0.12);
  --ui-success-border: #10b981;
  --ui-danger-bg: #ef4444;
  --modal-bg: #ffffff;
  --ui-shell-shadow: 0 3px 16px rgba(15, 23, 42, 0.05);
  --ui-shadow: 0 18px 48px rgba(15, 23, 42, 0.1);
  --primary-color: var(--ui-accent);
  --secondary-color: #3b82f6;
  --accent-color: #60a5fa;
  --dark-color: var(--ui-text);
  --light-color: var(--ui-surface);
  --success-color: var(--ui-success);
  --warning-color: var(--ui-warning);
  --danger-color: var(--ui-danger);
}
.memo-weekly-plan-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--ui-text-muted, #64748b);
  font-size: 0.78rem;
  cursor: pointer;
}

/* ── 主题切换动画（View Transitions API 圆形扩散）── */

/* 禁用浏览器默认淡入淡出 */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* 切换到深色：新主题从按钮位置向外圆形扩散 */
html.to-dark::view-transition-new(root) {
  animation: theme-circle-in 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
/* 切换到浅色：旧深色主题从按钮位置向内收缩 */
html.to-light::view-transition-old(root) {
  animation: theme-circle-out 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  z-index: 1;
}
html.to-light::view-transition-new(root) {
  animation: none;
  z-index: 0;
}

@keyframes theme-circle-in {
  from { clip-path: circle(0px at var(--theme-x, 50%) var(--theme-y, 50%)); }
  to   { clip-path: circle(var(--theme-r, 2000px) at var(--theme-x, 50%) var(--theme-y, 50%)); }
}
@keyframes theme-circle-out {
  from { clip-path: circle(var(--theme-r, 2000px) at var(--theme-x, 50%) var(--theme-y, 50%)); }
  to   { clip-path: circle(0px at var(--theme-x, 50%) var(--theme-y, 50%)); }
}

/* 旧浏览器降级：无 View Transitions API 时的 CSS 过渡兜底 */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition:
    background-color 0.3s ease,
    background 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    opacity 0.3s ease !important;
}
html.theme-transitioning img,
html.theme-transitioning video,
html.theme-transitioning canvas,
html.theme-transitioning svg {
  transition: none !important;
}

html[data-theme='dark'],
html.dark,
:root[data-theme='dark'],
:root.dark,
[data-bs-theme='dark'],
body[data-theme='dark'] {
  color-scheme: dark !important;
  --slate-1: #090d16;
  --slate-2: #111827;
  --slate-3: #1a2234;
  --slate-4: #243048;
  --slate-5: #2f3e5c;
  --slate-6: #3b4d70;
  --slate-7: #4d628c;
  --slate-8: #687fa8;
  --slate-9: #8da1c4;
  --slate-10: #a8b8d4;
  --slate-11: #cbd5e1;
  --slate-12: #f8fafc;

  --blue-9: #3b82f6;
  --blue-10: #2563eb;
  --blue-11: #60a5fa;
  --green-9: #10b981;
  --red-9: #ef4444;

  --ui-page: #090d16;
  --ui-surface: #111827;
  --ui-surface-soft: #1a2234;
  --ui-surface-hover: #243048;
  --ui-border: rgba(255, 255, 255, 0.09);
  --ui-border-strong: rgba(255, 255, 255, 0.18);
  --ui-text: #f8fafc;
  --ui-text-muted: #94a3b8;
  --ui-accent: #3b82f6;
  --ui-accent-soft: rgba(59, 130, 246, 0.16);
  --ui-focus-ring: rgba(59, 130, 246, 0.4);
  --ui-button-bg: #2563eb;
  --ui-button-text: #ffffff;
  --ui-button-hover: #1d4ed8;
  --ui-success-bg: #10b981;
  --ui-success-soft: rgba(16, 185, 129, 0.18);
  --ui-success-border: rgba(16, 185, 129, 0.35);
  --ui-danger-bg: #ef4444;
  --modal-bg: #111827;
  --ui-shell-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  --ui-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  --primary-color: var(--ui-accent);
  --secondary-color: #60a5fa;
  --accent-color: #3b82f6;
  --dark-color: var(--ui-text);
  --light-color: var(--ui-surface);
}

html[data-theme='light'],
html.light,
:root[data-theme='light'],
:root.light,
body[data-theme='light'] {
  color-scheme: light !important;
}

/* Force dark color-scheme on form controls so native datepickers & menus render dark */
html[data-theme='dark'] :is(input, select, textarea, button, form, .modal, .modal-content, #memoModal, #memoForm, .form-control) {
  color-scheme: dark !important;
}

html[data-theme='light'] :is(input, select, textarea, button, form, .modal, .modal-content, #memoModal, #memoForm, .form-control) {
  color-scheme: light !important;
}

/* Chrome autofill dark background override */
html[data-theme='dark'] input:-webkit-autofill,
html[data-theme='dark'] input:-webkit-autofill:hover,
html[data-theme='dark'] input:-webkit-autofill:focus,
html[data-theme='dark'] textarea:-webkit-autofill,
html[data-theme='dark'] textarea:-webkit-autofill:hover,
html[data-theme='dark'] textarea:-webkit-autofill:focus,
html[data-theme='dark'] select:-webkit-autofill,
html[data-theme='dark'] select:-webkit-autofill:hover,
html[data-theme='dark'] select:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--ui-surface, #18191b) inset !important;
  -webkit-text-fill-color: var(--ui-text, #edeef0) !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* Native date/time picker calendar icons - custom crisp Tabler SVG vectors */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2370b8ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12'/%3E%3Cpath d='M16 3v4'/%3E%3Cpath d='M8 3v4'/%3E%3Cpath d='M4 11h16'/%3E%3Cpath d='M11 15h1'/%3E%3Cpath d='M12 15v3'/%3E%3C/svg%3E") !important;
  background-position: center !important;
  background-size: 18px 18px !important;
  background-repeat: no-repeat !important;
  cursor: pointer !important;
  filter: none !important;
  opacity: 1 !important;
  width: 24px !important;
  height: 24px !important;
  padding: 2px !important;
  border-radius: 4px;
  transition: background-image 0.15s, opacity 0.15s;
}

input[type="time"]::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2370b8ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0'/%3E%3Cpath d='M12 7v5l3 3'/%3E%3C/svg%3E") !important;
  background-position: center !important;
  background-size: 18px 18px !important;
  background-repeat: no-repeat !important;
  cursor: pointer !important;
  filter: none !important;
  opacity: 1 !important;
  width: 24px !important;
  height: 24px !important;
  padding: 2px !important;
  border-radius: 4px;
  transition: background-image 0.15s, opacity 0.15s;
}

html[data-theme='dark'] input[type="date"]::-webkit-calendar-picker-indicator:hover,
html[data-theme='dark'] input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
html[data-theme='dark'] input[type="month"]::-webkit-calendar-picker-indicator:hover,
html[data-theme='dark'] input[type="week"]::-webkit-calendar-picker-indicator:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12'/%3E%3Cpath d='M16 3v4'/%3E%3Cpath d='M8 3v4'/%3E%3Cpath d='M4 11h16'/%3E%3Cpath d='M11 15h1'/%3E%3Cpath d='M12 15v3'/%3E%3C/svg%3E") !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme='dark'] input[type="time"]::-webkit-calendar-picker-indicator:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0'/%3E%3Cpath d='M12 7v5l3 3'/%3E%3C/svg%3E") !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme='light'] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme='light'] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
html[data-theme='light'] input[type="month"]::-webkit-calendar-picker-indicator,
html[data-theme='light'] input[type="week"]::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2360646c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12'/%3E%3Cpath d='M16 3v4'/%3E%3Cpath d='M8 3v4'/%3E%3Cpath d='M4 11h16'/%3E%3Cpath d='M11 15h1'/%3E%3Cpath d='M12 15v3'/%3E%3C/svg%3E") !important;
}

html[data-theme='light'] input[type="time"]::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2360646c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0'/%3E%3Cpath d='M12 7v5l3 3'/%3E%3C/svg%3E") !important;
}

html[data-theme='light'] input[type="date"]::-webkit-calendar-picker-indicator:hover,
html[data-theme='light'] input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
html[data-theme='light'] input[type="month"]::-webkit-calendar-picker-indicator:hover,
html[data-theme='light'] input[type="week"]::-webkit-calendar-picker-indicator:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23006adc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12'/%3E%3Cpath d='M16 3v4'/%3E%3Cpath d='M8 3v4'/%3E%3Cpath d='M4 11h16'/%3E%3Cpath d='M11 15h1'/%3E%3Cpath d='M12 15v3'/%3E%3C/svg%3E") !important;
  background-color: rgba(0, 0, 0, 0.05) !important;
}

html[data-theme='light'] input[type="time"]::-webkit-calendar-picker-indicator:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23006adc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0'/%3E%3Cpath d='M12 7v5l3 3'/%3E%3C/svg%3E") !important;
  background-color: rgba(0, 0, 0, 0.05) !important;
}

/* Checkbox & Radio native high-contrast polish */
html[data-theme='dark'] input[type="checkbox"],
html[data-theme='dark'] input[type="radio"] {
  accent-color: var(--ui-accent);
}

/* Tabler component pilot: keep the existing modal behavior and share Radix tokens. */
html[data-theme] :is(#functionsModal, #memoModal, #dailyDetailModal, #reminderModal) .modal-content,
html[data-theme] #reminderModal .reminder-content {
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 16px !important;
  box-shadow: var(--ui-shadow) !important;
  color: var(--ui-text) !important;
}

html[data-theme] :is(#functionsModal, #memoModal, #dailyDetailModal, #reminderModal) :is(.modal-header, .modal-footer, .reminder-header, .reminder-footer) {
  background: var(--ui-surface) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
}

html[data-theme] :is(#functionsModal, #memoModal, #dailyDetailModal, #reminderModal) :is(.modal-body, .reminder-list) {
  background: var(--ui-surface) !important;
  color: var(--ui-text) !important;
}

html[data-theme] :is(#functionsModal, #memoModal, #dailyDetailModal, #reminderModal) :is(.modal-title, .reminder-title) {
  color: var(--ui-text) !important;
}

html[data-theme] :is(#functionsModal, #memoModal, #dailyDetailModal, #reminderModal) :is(.close-modal, .close-reminder),
.close-modal,
.close-reminder {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  font-size: 0 !important;
  color: var(--ui-text-muted) !important;
  background: var(--ui-surface-soft) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 9px !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  flex: 0 0 32px !important;
  flex-shrink: 0 !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

html[data-theme] :is(#functionsModal, #memoModal, #dailyDetailModal, #reminderModal) :is(.close-modal, .close-reminder):hover,
.close-modal:hover,
.close-reminder:hover {
  color: var(--ui-text) !important;
  background: var(--ui-surface-hover) !important;
  border-color: var(--ui-border-strong) !important;
  transform: scale(1.05);
}

html[data-theme] :is(#functionsModal, #memoModal, #dailyDetailModal, #reminderModal) :is(.close-modal, .close-reminder):active,
.close-modal:active,
.close-reminder:active {
  transform: scale(0.95);
}

html[data-theme] :is(#functionsModal, #memoModal, #dailyDetailModal, #reminderModal) :is(.close-modal, .close-reminder) svg,
.close-modal svg,
.close-reminder svg {
  width: 14px !important;
  height: 14px !important;
  display: block !important;
  stroke: currentColor !important;
  flex-shrink: 0 !important;
  pointer-events: none !important;
}


/* 提醒中心 - 消息记录轻量按钮 */
.notif-history-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ui-text-muted, #64748b);
  background: transparent;
  border: 1px solid var(--ui-border, rgba(0,0,0,0.1));
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  margin-right: 6px;
}
.notif-history-btn i {
  font-size: 0.75rem;
  opacity: 0.8;
}
.notif-history-btn:hover {
  color: var(--primary-color, #4361ee);
  background: rgba(67, 97, 238, 0.07);
  border-color: rgba(67, 97, 238, 0.25);
}
.notif-history-btn:active {
  transform: scale(0.96);
}
html[data-theme='dark'] .notif-history-btn {
  color: var(--ui-text-muted, #94a3b8);
  border-color: rgba(255,255,255,0.1);
}
html[data-theme='dark'] .notif-history-btn:hover {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

html[data-theme] :is(#functionsModal, #memoModal) .form-group label {
  color: var(--ui-text-muted) !important;
}

html[data-theme] :is(#functionsModal, #memoModal) .form-control {
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border-strong) !important;
  border-radius: 9px !important;
  color: var(--ui-text) !important;
}

html[data-theme] :is(#functionsModal, #memoModal) .form-control:focus-visible {
  border-color: var(--ui-accent) !important;
  outline: 2px solid var(--ui-focus-ring) !important;
  outline-offset: 1px;
}

html[data-theme] :is(#functionsModal, #memoModal) .form-control::placeholder {
  color: var(--ui-text-muted) !important;
  opacity: 1;
}

html[data-theme] #functionsModal .tabs {
  display: flex;
  flex-wrap: nowrap !important;
  justify-content: flex-start !important;
  gap: 5px;
  padding: 5px;
  margin-bottom: 18px;
  border: 1px solid var(--ui-border) !important;
  border-radius: 11px;
  background: var(--ui-surface-soft) !important;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-border-strong) transparent;
}

#functionsModal .tabs::-webkit-scrollbar { height: 5px; }
#functionsModal .tabs::-webkit-scrollbar-track { background: transparent; }
#functionsModal .tabs::-webkit-scrollbar-thumb {
  background: var(--ui-border-strong);
  border-radius: 999px;
}

html[data-theme] #functionsModal .tab {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 37px;
  padding: 8px 11px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--ui-text-muted) !important;
  white-space: nowrap;
  font-weight: 600;
}

html[data-theme] #functionsModal .tab:hover {
  background: var(--ui-surface-hover) !important;
  color: var(--ui-text) !important;
}

html[data-theme] #functionsModal .tab.active {
  background: var(--ui-surface) !important;
  color: var(--ui-accent) !important;
  box-shadow: 0 1px 4px rgba(28, 32, 36, 0.13) !important;
}

html[data-theme] #functionsModal .tab::after {
  display: none !important;
}

html[data-theme] #functionsModal .tab:focus-visible {
  outline: 2px solid var(--ui-focus-ring) !important;
  outline-offset: -2px;
}

html[data-theme] #functionsModal .tab-content h3 {
  color: var(--ui-text) !important;
}

html[data-theme] #functionsModal #dataManagementTab > p {
  color: var(--ui-text-muted) !important;
}

html[data-theme] #functionsModal .task-publish-info,
html[data-theme] #functionsModal .export-info,
html[data-theme] #functionsModal .task-assignee-panel {
  background: var(--ui-surface-soft) !important;
  border: 1px solid var(--ui-border) !important;
  color: var(--ui-text-muted) !important;
}

html[data-theme] #functionsModal .task-publish-info :is(h4, strong),
html[data-theme] #functionsModal .export-info :is(h4, strong) {
  color: var(--ui-text) !important;
}

/* Tabler Icons 3.48.0, local SVG masks; the button labels stay readable. */
#functionsModal .tabler-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--tabler-icon) center / contain no-repeat;
  mask: var(--tabler-icon) center / contain no-repeat;
}

#functionsModal [data-tab='taskPublish'] .tabler-icon { --tabler-icon: url('./vendor/tabler-icons/send.svg'); }
#functionsModal [data-tab='dataManagement'] .tabler-icon { --tabler-icon: url('./vendor/tabler-icons/database.svg'); }
#functionsModal [data-tab='userManagement'] .tabler-icon { --tabler-icon: url('./vendor/tabler-icons/users.svg'); }
#functionsModal [data-tab='opsMonitor'] .tabler-icon { --tabler-icon: url('./vendor/tabler-icons/activity.svg'); }
#functionsModal [data-tab='reminderSettings'] .tabler-icon { --tabler-icon: url('./vendor/tabler-icons/bell.svg'); }

@media (max-width: 640px) {
  html[data-theme] #functionsModal .tab {
    min-height: 42px;
    padding: 9px 10px !important;
  }
}

/* ========================================================
   现代化极简滚动条系统 (Global & Day Memos Scrollbar System)
   ======================================================== */

/* 1. 日历格内备忘录：极细4px悬浮胶囊上下滚动条（悬停点亮、平滑拖拽、禁用丑陋上下箭头） */
.day-memos,
.calendar-day .day-memos {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
  -ms-overflow-style: auto;
  padding-right: 2px;
  box-sizing: border-box;
}

.day-memos::-webkit-scrollbar,
.calendar-day .day-memos::-webkit-scrollbar {
  display: block !important;
  width: 4px !important;
  height: 4px !important;
}

.day-memos::-webkit-scrollbar-track,
.calendar-day .day-memos::-webkit-scrollbar-track {
  background: transparent !important;
}

.day-memos::-webkit-scrollbar-thumb,
.calendar-day .day-memos::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.38) !important;
  border-radius: 999px !important;
  transition: background 0.2s ease;
}

.day-memos:hover::-webkit-scrollbar-thumb,
.calendar-day:hover .day-memos::-webkit-scrollbar-thumb {
  background: rgba(67, 97, 238, 0.65) !important;
}

.day-memos::-webkit-scrollbar-thumb:hover,
.calendar-day .day-memos::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color, #4361ee) !important;
}

.day-memos::-webkit-scrollbar-button,
.calendar-day .day-memos::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* 2. 全局通用浮动滚动条（针对弹窗列表、长内容区域）：超细、圆角胶囊、无上下箭头 */
::-webkit-scrollbar {
  width: 6px !important;
  height: 6px !important;
}

::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

::-webkit-scrollbar-track {
  background: transparent !important;
}

::-webkit-scrollbar-thumb {
  background: var(--ui-border-strong, rgba(140, 145, 155, 0.4)) !important;
  border-radius: 9999px !important;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ui-text-muted, rgba(100, 105, 115, 0.7)) !important;
}

::-webkit-scrollbar-corner {
  background: transparent !important;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--ui-border-strong, rgba(140, 145, 155, 0.4)) transparent;
}

/* Tabler cards now carry the workbench, while the calendar day grid keeps its layout. */
html[data-theme] #appTopbar.card,
html[data-theme] .container .workspace-subbar.card,
html[data-theme] #multiMonthCalendar .month-calendar.card,
html[data-theme] #dashboardPage .dashboard-card.card {
  --tblr-card-bg: var(--ui-surface);
  --tblr-card-border-color: var(--ui-border);
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border) !important;
  box-shadow: var(--ui-shell-shadow) !important;
  color: var(--ui-text) !important;
  border-radius: 12px !important;
}

html[data-theme] #appTopbar.card,
#appTopbar {
  flex-direction: row;
  overflow: visible !important;
  position: relative !important;
  z-index: 60 !important;
}

html[data-theme] #appTopbar .app-title,
html[data-theme] #appTopbar .topbar-user-badge strong,
html[data-theme] #appTopbar .current-period {
  color: var(--ui-text) !important;
}

html[data-theme] #appTopbar :is(.topbar-user-badge, .topbar-nav, .topbar-theme-toggle, .topbar-logout-btn) {
  background: var(--ui-surface-soft) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text-muted) !important;
}

html[data-theme] #appTopbar .topbar-nav .nav-button,
html[data-theme] #appTopbar .topbar-member-selector {
  color: var(--ui-text-muted) !important;
}

html[data-theme] #appTopbar :is(.topbar-theme-toggle, .topbar-logout-btn):hover,
html[data-theme] #appTopbar .topbar-nav .nav-button:hover {
  background: var(--ui-surface-hover) !important;
  color: var(--ui-text) !important;
}

html[data-theme] #appTopbar .topbar-nav .today-btn {
  background: var(--ui-button-bg) !important;
  color: var(--ui-button-text) !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

html[data-theme] #appTopbar .topbar-nav .today-btn:hover {
  background: var(--ui-button-hover) !important;
  color: var(--ui-button-text) !important;
}

html[data-theme] #appTopbar #serverMemberSelect.form-select {
  background-color: var(--ui-surface) !important;
  border-color: var(--ui-border-strong) !important;
  color: var(--ui-text) !important;
}

/* 彻底清除 Tabler 框架对 .toolbar 注入的负外边距与子项边距，消除宽度外扩与左右边距不对齐 */
:is(.toolbar, .workspace-subbar, html[data-theme] .container .workspace-subbar.card) {
  --tblr-toolbar-gutter: 0px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

:is(.toolbar, .workspace-subbar) > * {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html[data-theme] .container .workspace-subbar.card,
.workspace-subbar {
  flex-direction: row;
  flex-wrap: wrap;
  position: relative !important;
  z-index: 50 !important;
  overflow: visible !important;
}

.workspace-subbar.has-open-menu,
.workspace-subbar:has(.toolbar-more[open]) {
  z-index: 120 !important;
}

html[data-theme] .workspace-subbar .search-container {
  background: var(--ui-surface-soft) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 8px !important;
  color: var(--ui-text) !important;
  position: relative;
  display: flex;
  align-items: center;
}

html[data-theme] .workspace-subbar #monthCountSelect.form-select {
  background: var(--ui-surface-soft) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 8px !important;
  color: var(--ui-text) !important;
}

html[data-theme] .workspace-subbar .search-container:focus-within {
  border-color: var(--ui-accent) !important;
  box-shadow: 0 0 0 3px var(--ui-accent-soft) !important;
}

html[data-theme] .workspace-subbar #searchInput.form-control,
.tabler-search #searchInput {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--ui-text) !important;
  padding: 8px 36px 8px 40px !important;
  min-height: 38px !important;
  line-height: 1.5 !important;
}

html[data-theme] .workspace-subbar #searchInput::placeholder { color: var(--ui-text-muted) !important; }
html[data-theme] .workspace-subbar .month-count-selector { color: var(--ui-text-muted) !important; }

html[data-theme] .workspace-subbar .toolbar-btn.btn {
  min-height: 39px;
  padding: 8px 13px !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-theme] .workspace-subbar :is(#toolbarPublish, #toolbarDashboard, .toolbar-more summary) {
  background: var(--ui-button-bg) !important;
  border: 1px solid transparent !important;
  color: var(--ui-button-text) !important;
}

html[data-theme] .workspace-subbar :is(#toolbarPublish, #toolbarDashboard, .toolbar-more summary):hover {
  background: var(--ui-button-hover) !important;
  color: var(--ui-button-text) !important;
}

html[data-theme] .workspace-subbar #toolbarExport {
  background: var(--ui-success-soft) !important;
  border: 1px solid var(--ui-success-border) !important;
  color: var(--ui-success) !important;
}

html[data-theme] .workspace-subbar #toolbarImport {
  background: var(--ui-surface-soft) !important;
  border: 1px solid var(--ui-border) !important;
  color: var(--ui-text-muted) !important;
}

html[data-theme] .workspace-subbar :is(#toolbarExport, #toolbarImport):hover {
  background: var(--ui-surface-hover) !important;
}

html[data-theme] #multiMonthCalendar .month-calendar.card {
  border-radius: 14px !important;
  min-width: 0;
}

html[data-theme] #multiMonthCalendar .month-header.card-header,
html[data-theme] #dashboardPage .dashboard-card-title.card-header {
  padding: 0 0 14px;
  border-bottom: 1px solid var(--ui-border) !important;
  background: transparent !important;
  color: var(--ui-text) !important;
}

html[data-theme] #multiMonthCalendar .month-header.card-header {
  margin-bottom: 16px;
}

html[data-theme] #dashboardPage .dashboard-card-title.card-header {
  margin-bottom: 14px;
}

html[data-theme] :is(#memoModal, #functionsModal, #dailyDetailModal) .btn {
  border-radius: 8px !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-theme] :is(#memoModal, #functionsModal, #dailyDetailModal) .btn-primary {
  background: var(--ui-button-bg) !important;
  border: 1px solid transparent !important;
  color: var(--ui-button-text) !important;
}

html[data-theme] :is(#memoModal, #functionsModal, #dailyDetailModal) .btn-secondary {
  background: var(--ui-surface-soft) !important;
  border: 1px solid var(--ui-border) !important;
  color: var(--ui-text) !important;
}

html[data-theme] :is(#memoModal, #functionsModal, #dailyDetailModal) .btn-success {
  background: var(--ui-success-soft) !important;
  border: 1px solid var(--ui-success-border) !important;
  color: var(--ui-success) !important;
}

html[data-theme] :is(#memoModal, #functionsModal, #dailyDetailModal) .btn-danger {
  background: var(--red-3) !important;
  border: 1px solid var(--red-7) !important;
  color: var(--ui-danger) !important;
}

html[data-theme] #dailyDetailModal .daily-quick-add-box.card,
html[data-theme] #memoModal #markdownPreview.card,
html[data-theme] #functionsModal :is(.task-publish-info, .export-info, .data-stats-card, .excel-export-panel).card {
  --tblr-card-bg: var(--ui-surface-soft);
  background: var(--ui-surface-soft) !important;
  border: 1px solid var(--ui-border) !important;
  box-shadow: none !important;
  color: var(--ui-text) !important;
}

html[data-theme] #dailyDetailModal #quickMemoTitle.form-control {
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border-strong) !important;
  color: var(--ui-text) !important;
}

html[data-theme] #dailyDetailModal #quickAddMemo.btn {
  background: var(--ui-button-bg) !important;
  color: var(--ui-button-text) !important;
  border: 1px solid transparent !important;
}

/* Local Tabler icon masks replace only the legacy icons on decorated controls. */
.tabler-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--tabler-icon) center / contain no-repeat;
  mask: var(--tabler-icon) center / contain no-repeat;
}

.tabler-decorated > i.fas,
.tabler-decorated > i.far { display: none !important; }

.tabler-icon[data-icon='calendar'] { --tabler-icon: url('./vendor/tabler-icons/calendar.svg'); }
.tabler-icon[data-icon='chart-bar'] { --tabler-icon: url('./vendor/tabler-icons/chart-bar.svg'); }
.tabler-icon[data-icon='chevron-left'] { --tabler-icon: url('./vendor/tabler-icons/chevron-left.svg'); }
.tabler-icon[data-icon='chevron-right'] { --tabler-icon: url('./vendor/tabler-icons/chevron-right.svg'); }
.tabler-icon[data-icon='file-spreadsheet'] { --tabler-icon: url('./vendor/tabler-icons/file-spreadsheet.svg'); }
.tabler-icon[data-icon='logout'] { --tabler-icon: url('./vendor/tabler-icons/logout.svg'); }
.tabler-icon[data-icon='plus'] { --tabler-icon: url('./vendor/tabler-icons/plus.svg'); }
.tabler-icon[data-icon='search'] { --tabler-icon: url('./vendor/tabler-icons/search.svg'); }
.tabler-icon[data-icon='settings'] { --tabler-icon: url('./vendor/tabler-icons/settings.svg'); }
.tabler-icon[data-icon='upload'] { --tabler-icon: url('./vendor/tabler-icons/upload.svg'); }
.tabler-icon[data-icon='send'] { --tabler-icon: url('./vendor/tabler-icons/send.svg'); }
.tabler-icon[data-icon='bell'] { --tabler-icon: url('./vendor/tabler-icons/bell.svg'); }
.tabler-icon[data-icon='database'] { --tabler-icon: url('./vendor/tabler-icons/database.svg'); }
.tabler-icon[data-icon='users'] { --tabler-icon: url('./vendor/tabler-icons/users.svg'); }
.tabler-icon[data-icon='activity'] { --tabler-icon: url('./vendor/tabler-icons/activity.svg'); }

.tabler-search > i.search-icon { display: none !important; }
.tabler-search > .tabler-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  transform: translateY(-50%);
  color: var(--ui-text-muted);
  pointer-events: none;
}

html[data-theme] :is(#prevMonth, #nextMonth, #themeToggleBtn, #calendarPrevMonth, #calendarNextMonth, #floatingReminder, #floatingFunctions).btn-icon {
  padding: 0 !important;
}

/* ========================================================
   日历主区域居中月份切换器 (Centered Calendar Month Nav)
   ======================================================== */
.calendar-container {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 14px !important;
  width: 100% !important;
  position: relative;
}

.calendar-container[hidden] {
  display: none !important;
}

.calendar-nav-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0 0 4px;
}

#calendarNavigation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border) !important;
  box-shadow: var(--ui-shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06)) !important;
}

#calendarNavigation .current-period {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ui-text) !important;
  padding: 0 14px;
  min-width: 130px;
  text-align: center;
  user-select: none;
  letter-spacing: 0.5px;
}

#calendarNavigation .nav-button:not(.today-btn) {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  border: 1px solid var(--ui-border) !important;
  background: var(--ui-surface-soft) !important;
  color: var(--ui-text-muted) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  font-size: 0.9rem !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#calendarNavigation .nav-button:not(.today-btn):hover {
  background: var(--ui-surface-hover) !important;
  color: var(--ui-text) !important;
  border-color: var(--ui-border-strong) !important;
}

#calendarNavigation :is(.today-btn, #goTodayBtn) {
  width: auto !important;
  min-width: 68px !important;
  height: 34px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  background: var(--ui-accent) !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 8px rgba(0, 106, 220, 0.28) !important;
  flex-shrink: 0 !important;
  overflow: visible !important;
  transition: filter 0.15s ease, transform 0.1s ease;
}

#calendarNavigation :is(.today-btn, #goTodayBtn):hover {
  filter: brightness(1.1);
}

.calendar-nav-btn {
  display: none !important;
}

/* ========================================================
   主题切换按钮移动端防卡顿与平滑微动效
   ======================================================== */
html[data-theme] :is(.topbar-theme-toggle, #themeToggleBtn) {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}

html[data-theme] :is(.topbar-theme-toggle, #themeToggleBtn):hover {
  transform: none !important;
}

html[data-theme] :is(.topbar-theme-toggle, #themeToggleBtn):active {
  transform: scale(0.92) !important;
}

/* 触控设备专属：全面禁用 hover 状态残留导致的伪类卡顿 */
@media (hover: none), (pointer: coarse) {
  html[data-theme] :is(.topbar-theme-toggle, #themeToggleBtn, .topbar-logout-btn, .nav-button, .btn) {
    transform: none !important;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease !important;
  }
  html[data-theme] :is(.topbar-theme-toggle, #themeToggleBtn, .topbar-logout-btn, .nav-button, .btn):hover {
    transform: none !important;
  }
  html[data-theme] :is(.topbar-theme-toggle, #themeToggleBtn):active {
    transform: scale(0.92) !important;
  }
}

/* 点击时图标顺畅单次旋转，结束后回到 0deg/360deg，绝不卡住或倾斜 */
@keyframes themeIconSpin {
  0% { transform: rotate(0deg) scale(0.8); opacity: 0.6; }
  100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

.theme-spin {
  display: inline-block;
  animation: themeIconSpin 0.35s ease-out;
}

/* ========================================================
   全站与各组件移动端深度自适应体系 (Comprehensive Mobile Responsive System)
   ======================================================== */

/* 1. iOS / Android 移动端全局输入框防缩放（强制 16px） */
@media (max-width: 768px) {
  input,
  select,
  textarea,
  .form-control,
  .search-input,
  .daily-quick-memo-input,
  .user-edit-grid input,
  .user-edit-grid select {
    font-size: 16px !important;
  }
}

/* 2. 顶部导航栏 (App Topbar) 移动端自适应 */
@media (max-width: 768px) {
  html[data-theme] #appTopbar.card {
    padding: 8px 12px !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    margin-bottom: 10px !important;
  }
  html[data-theme] #appTopbar .topbar-left {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    gap: 8px !important;
  }
  html[data-theme] #appTopbar .app-brand {
    gap: 6px !important;
    flex-shrink: 0 !important;
  }
  html[data-theme] #appTopbar .app-brand .app-logo {
    font-size: 1.2rem !important;
  }
  html[data-theme] #appTopbar .app-brand .app-title {
    font-size: 1.05rem !important;
  }
  html[data-theme] #appTopbar .topbar-user-badge {
    font-size: 0.76rem !important;
    padding: 2px 7px !important;
    max-width: 110px !important;
    overflow: visible !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  html[data-theme] #appTopbar #serverUserRole {
    display: none !important;
  }
  html[data-theme] #appTopbar .topbar-right {
    gap: 6px !important;
    flex-shrink: 0 !important;
  }
  html[data-theme] #appTopbar .topbar-member-selector label {
    display: none !important; /* 手机端隐藏“成员：”文本，仅保留下拉框 */
  }
  html[data-theme] #appTopbar .topbar-member-selector select {
    max-width: 92px !important;
    font-size: 0.82rem !important;
    padding: 4px 6px !important;
    height: 32px !important;
  }
  html[data-theme] #appTopbar .topbar-theme-toggle {
    width: 32px !important;
    height: 32px !important;
  }
  html[data-theme] #appTopbar .topbar-logout-btn {
    height: 32px !important;
    padding: 0 8px !important;
  }
  html[data-theme] #appTopbar .topbar-logout-btn .logout-text {
    display: none !important; /* 手机端隐藏“退出”文字，仅留精致图标 */
  }
}

/* 3. 工具栏与操作按钮 (Toolbar & Buttons) 移动端自适应 */
@media (max-width: 768px) {
  html[data-theme] .container .workspace-subbar.card {
    padding: 10px 12px !important;
    gap: 10px !important;
    flex-direction: column !important;
  }
  html[data-theme] .workspace-subbar .search-container {
    width: 100% !important;
    min-width: 0 !important;
  }
  html[data-theme] .workspace-subbar .month-count-selector {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  html[data-theme] .workspace-subbar .month-count-selector select {
    flex: 1 !important;
    margin-left: 8px !important;
  }
  html[data-theme] .workspace-subbar .toolbar-buttons {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    position: relative !important;
    overflow: visible !important;
  }
  html[data-theme] .workspace-subbar .toolbar-buttons .toolbar-btn,
  html[data-theme] .workspace-subbar .toolbar-more summary {
    width: 100% !important;
    justify-content: center !important;
    padding: 8px 10px !important;
    font-size: 0.85rem !important;
    min-height: 38px !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
  html[data-theme] .workspace-subbar .toolbar-more {
    width: 100% !important;
    position: relative !important;
  }
  html[data-theme] .workspace-subbar .toolbar-buttons .toolbar-btn.toolbar-btn-full {
    grid-column: 1 / -1 !important;
  }
  html[data-theme] .workspace-subbar .toolbar-more-menu {
    right: 0 !important;
    min-width: 160px !important;
    max-width: calc(100vw - 32px) !important;
  }
}

/* 4. 日历居中月份切换器 (Calendar Month Nav) 移动端自适应 */
@media (max-width: 768px) {
  .calendar-nav-wrap {
    margin: 4px 0 10px !important;
  }
  #calendarNavigation {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    padding: 4px 10px !important;
    box-sizing: border-box !important;
  }
  #calendarNavigation .current-period {
    min-width: 0 !important;
    flex: 1 !important;
    font-size: 0.96rem !important;
    padding: 0 6px !important;
    text-align: center !important;
  }
  #calendarNavigation .nav-button:not(.today-btn) {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
  }
  #calendarNavigation :is(.today-btn, #goTodayBtn) {
    width: auto !important;
    min-width: 60px !important;
    height: 32px !important;
    padding: 0 10px !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
  }
}

/* 5. 竞赛排行榜 (Team Leaderboard) 移动端自适应 */
@media (max-width: 768px) {
  html[data-theme] .team-leaderboard {
    padding: 12px 14px !important;
    margin-bottom: 14px !important;
  }
  html[data-theme] .leaderboard-header {
    flex-direction: column !important;
    gap: 10px !important;
  }
  html[data-theme] .leaderboard-header h2 {
    font-size: 1.25rem !important;
  }
  html[data-theme] .leaderboard-champion {
    min-width: 0 !important;
    width: 100% !important;
  }
  html[data-theme] .leaderboard-card {
    padding: 8px 10px !important;
  }
}

/* 6. 全局模态窗口容器 (Universal Modal Shell) 移动端自适应居中弹窗 */
@media (max-width: 768px) {
  .modal,
  .reminder-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)) 12px !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    box-sizing: border-box !important;
    z-index: 2000 !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .modal.active,
  .reminder-modal.active {
    display: flex !important;
  }

  :is(.modal, .reminder-modal) :is(.modal-content, .reminder-content),
  html[data-theme] :is(#functionsModal, #memoModal, #dailyDetailModal, #reminderModal) :is(.modal-content, .reminder-content) {
    width: 100% !important;
    max-width: min(100%, 540px) !important;
    max-height: calc(100vh - 32px) !important;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px) !important;
    margin: auto !important;
    border-radius: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    transform: none !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid var(--ui-border) !important;
    position: relative !important;
  }

  .modal.active :is(.modal-content, .reminder-content),
  .reminder-modal.active :is(.modal-content, .reminder-content),
  html[data-theme] :is(#functionsModal, #memoModal, #dailyDetailModal, #reminderModal).active :is(.modal-content, .reminder-content) {
    transform: none !important;
  }

  /* 移除底部抽屉下拉触手 */
  :is(.modal, .reminder-modal) :is(.modal-content, .reminder-content)::before {
    display: none !important;
    content: none !important;
  }

  .modal-header,
  .reminder-header {
    padding: 10px 14px !important;
    min-height: 44px !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
  }
  .modal-title,
  .reminder-title {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
  }
  .close-modal,
  .close-reminder {
    width: 32px !important;
    height: 32px !important;
    font-size: 1.25rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
  }
  .modal-body,
  .reminder-body {
    padding: 12px 14px !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }
  .modal-footer,
  .reminder-actions {
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    min-height: 48px !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    border-top: 1px solid var(--ui-border) !important;
    position: static !important;
  }
  .modal-footer .btn,
  .reminder-actions .btn {
    flex: 1 1 auto !important;
    min-height: 38px !important;
    padding: 7px 12px !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    border-radius: 9px !important;
    justify-content: center !important;
  }
}

/* 7. 备忘录编辑弹窗 (memoModal) 移动端专属细节 */
@media (max-width: 600px) {
  #memoModal .form-group {
    margin-bottom: 8px !important;
  }
  #memoModal .form-group label {
    margin: 2px 0 4px !important;
    font-size: 0.82rem !important;
  }
  #memoModal .form-control {
    min-height: 36px !important;
    padding: 6px 10px !important;
    font-size: 16px !important;
  }
  #memoModal .mcp-time-input {
    font-size: 16px !important;
  }
  .memo-title-row {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px !important;
  }
  .memo-title-completed {
    padding: 4px 10px !important;
    min-height: 36px !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
  }
  #memoModal .form-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  #memoModal #colorOptions {
    display: flex !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    gap: 6px !important;
    margin-top: 4px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }
  #memoModal #colorOptions::-webkit-scrollbar {
    display: none !important;
  }
  #memoModal .color-option {
    width: 26px !important;
    height: 26px !important;
  }
  #memoModal .memo-content-header {
    margin-bottom: 4px !important;
  }
  #memoModal .memo-text-editor #memoContent {
    min-height: 180px !important;
    height: clamp(180px, 28vh, 240px) !important;
    font-size: 16px !important;
    padding: 8px 10px !important;
  }
  #memoModal .memo-text-toolbar {
    padding: 4px 6px !important;
    min-height: 32px !important;
    gap: 4px !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  #memoModal .memo-text-toolbar::-webkit-scrollbar {
    display: none !important;
  }
  #memoModal .memo-text-tool {
    min-width: 28px !important;
    height: 28px !important;
    font-size: 0.76rem !important;
  }
  #memoModal .memo-text-helper {
    padding: 3px 2px !important;
    font-size: 0.72rem !important;
  }
  #memoModal .markdown-preview {
    max-height: 120px !important;
  }
  /* 弹窗底部操作按钮单行紧凑排布 */
  #memoModal .modal-footer {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  }
  #memoModal .modal-footer #saveMemo {
    flex: 1 1 auto !important;
    order: 3 !important;
    font-weight: 700 !important;
    min-height: 38px !important;
    font-size: 0.9rem !important;
  }
  #memoModal .modal-footer #cancelMemo {
    flex: 0 0 auto !important;
    order: 1 !important;
    min-height: 38px !important;
  }
  #memoModal .modal-footer #deleteMemo {
    flex: 0 0 auto !important;
    order: 2 !important;
    min-height: 38px !important;
  }
}

/* 8. 功能面板弹窗 (functionsModal) 移动端专属细节 */
@media (max-width: 768px) {
  html[data-theme] #functionsModal .modal-content {
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 16px) !important;
    border-radius: 14px !important;
  }
  html[data-theme] #functionsModal .modal-header {
    min-height: 42px !important;
    padding: 8px 12px !important;
  }
  html[data-theme] #functionsModal .modal-body {
    padding: 8px 10px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    overscroll-behavior-y: contain !important;
  }
  html[data-theme] #functionsModal .tabs {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 3px !important;
    padding: 3px !important;
    margin: 0 0 10px !important;
    position: sticky !important;
    top: -8px !important;
    z-index: 12 !important;
    overflow: visible !important;
    scrollbar-width: none !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06) !important;
  }
  html[data-theme] #functionsModal .tab {
    min-width: 0 !important;
    min-height: 38px !important;
    padding: 6px 2px !important;
    border-radius: 7px !important;
    font-size: 0.74rem !important;
    line-height: 1.15 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    justify-content: center !important;
    gap: 0 !important;
  }
  html[data-theme] #functionsModal .tab :is(i, svg) {
    display: none !important;
  }
  html[data-theme] #functionsModal .tab-content > h3 {
    margin: 2px 0 10px !important;
    font-size: 1rem !important;
    line-height: 1.3 !important;
  }
  html[data-theme] #functionsModal .form-group {
    margin-bottom: 10px !important;
  }
  html[data-theme] #functionsModal .form-group > label {
    margin-bottom: 4px !important;
    font-size: 0.82rem !important;
    line-height: 1.35 !important;
  }
  html[data-theme] #functionsModal .form-control {
    min-height: 40px !important;
    height: 40px !important;
    padding: 6px 10px !important;
    border-radius: 9px !important;
    font-size: 16px !important;
  }
  html[data-theme] #functionsModal textarea.form-control {
    height: auto !important;
    min-height: 92px !important;
  }
  html[data-theme] #functionsModal input[type='checkbox'] {
    width: 18px !important;
    height: 18px !important;
    margin: 0 6px 0 0 !important;
    vertical-align: -3px !important;
  }
  html[data-theme] #functionsModal #desktopNotificationStatus {
    margin-top: 4px !important;
    font-size: 0.76rem !important;
    line-height: 1.4 !important;
  }
  html[data-theme] #functionsModal :is(#publishTask, #testReminder, #saveReminderSettings) {
    width: 100% !important;
    min-height: 40px !important;
    padding: 7px 10px !important;
    justify-content: center !important;
    font-size: 0.88rem !important;
  }
  html[data-theme] #functionsModal :is(.task-publish-info, .export-info) {
    margin-top: 12px !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    font-size: 0.8rem !important;
    line-height: 1.45 !important;
  }
  html[data-theme] #functionsModal :is(.task-publish-info, .export-info) h4 {
    margin-bottom: 4px !important;
    font-size: 0.86rem !important;
  }
  html[data-theme] #functionsModal .export-info ul {
    margin: 5px 0 0 !important;
    padding-left: 17px !important;
  }
  html[data-theme] #functionsModal .modal-footer {
    display: none !important;
  }
  #functionsModal .form-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  #publishTask {
    width: 100% !important;
    min-height: 40px !important;
    font-size: 0.88rem !important;
    justify-content: center !important;
  }
  .excel-export-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .excel-export-actions {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 7px !important;
  }
  .excel-export-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    font-size: 0.8rem !important;
    padding: 7px 5px !important;
    min-height: 36px !important;
  }
  .data-management-buttons {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 7px !important;
  }
  .data-management-buttons .btn {
    width: 100% !important;
    justify-content: center !important;
    font-size: 0.8rem !important;
    padding: 7px 5px !important;
    min-height: 36px !important;
  }
  .ops-status-summary {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 7px !important;
  }
  .ops-card {
    padding: 9px !important;
  }
  .user-management-meta {
    flex-direction: column !important;
    gap: 3px !important;
  }
  .user-edit-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 360px) {
  html[data-theme] #functionsModal .tab {
    font-size: 0.7rem !important;
    padding-inline: 1px !important;
  }
}

/* 9. 每日备忘录详情弹窗 (dailyDetailModal) 移动端专属细节 */
@media (max-width: 600px) {
  #dailyDetailModal .modal-title {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
  }
  #dailyDetailModal #dailyDetailDate {
    margin-left: 0 !important;
    font-size: 0.88rem !important;
    opacity: 0.85 !important;
  }
  .daily-quick-add-row {
    grid-template-columns: minmax(0, 1fr) 68px !important;
    gap: 8px !important;
  }
  .daily-quick-add-btn {
    padding: 8px 12px !important;
    min-height: 38px !important;
    font-size: 0.88rem !important;
  }
  #dailyDetailList {
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }
  #dailyDetailModal .task-item {
    padding: 10px 12px !important;
    margin-bottom: 8px !important;
  }
  #dailyDetailModal .task-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  #dailyDetailModal .task-btn {
    flex: 1 1 auto !important;
    min-height: 36px !important;
    padding: 6px 10px !important;
    font-size: 0.82rem !important;
  }
  #dailyDetailModal .modal-footer {
    display: flex !important;
    gap: 8px !important;
  }
  #dailyDetailModal .modal-footer .btn {
    flex: 1 !important;
    min-height: 40px !important;
  }
}

/* 10. 到期提醒弹窗 (reminderModal) 移动端专属细节 */
@media (max-width: 600px) {
  .reminder-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px 16px !important;
  }
  .reminder-actions .export-buttons-container,
  .reminder-actions .btn {
    width: 100% !important;
    min-height: 40px !important;
    justify-content: center !important;
  }
}

/* ========================================================
   刷新与加载弹窗主题自适应 (Session & Loading Modal Theming)
   ======================================================== */
html[data-theme] #serverSessionOverlay {
  background: var(--ui-page, #0f172a) !important;
}

html[data-theme='light'] #serverSessionOverlay {
  background: rgba(248, 250, 252, 0.95) !important;
}

html[data-theme='dark'] #serverSessionOverlay {
  background: rgba(11, 15, 25, 0.95) !important;
}

html[data-theme] .server-session-card {
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border) !important;
  box-shadow: var(--ui-shadow) !important;
  color: var(--ui-text) !important;
  border-radius: 20px !important;
}

html[data-theme] .server-session-card h2 {
  color: var(--ui-text) !important;
  font-weight: 700 !important;
}

html[data-theme] .server-session-card p {
  color: var(--ui-text-muted) !important;
}

html[data-theme='light'] .server-session-spinner {
  border: 4px solid rgba(67, 97, 238, 0.14) !important;
  border-top-color: var(--ui-accent, #4361ee) !important;
}

html[data-theme='light'] .server-session-percent {
  color: var(--ui-accent, #4361ee) !important;
}

html[data-theme='light'] .server-session-progress {
  background: rgba(67, 97, 238, 0.1) !important;
}

html[data-theme='light'] .server-session-progress-fill {
  background: linear-gradient(90deg, #4361ee, #06b6d4) !important;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4) !important;
}

html[data-theme='dark'] .server-session-card {
  background: rgba(18, 24, 38, 0.96) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

html[data-theme='dark'] .server-session-spinner {
  border: 4px solid rgba(56, 189, 248, 0.18) !important;
  border-top-color: #38bdf8 !important;
}

html[data-theme='dark'] .server-session-percent {
  color: #38bdf8 !important;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.4) !important;
}

html[data-theme='dark'] .server-session-progress {
  background: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme='dark'] .server-session-progress-fill {
  background: linear-gradient(90deg, #38bdf8, #10b981) !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5) !important;
}

html[data-theme] .server-session-actions button {
  background: var(--ui-button-bg) !important;
  color: var(--ui-button-text) !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
}

/* ========================================================
   日历区域文字粗细与排版精细化 (Calendar Typography Refinement)
   - 彻底解决 Windows 微软雅黑 600/700 导致的字体过粗、笔画油墨粘连与黑坨感
   - 备忘录条目采用优雅清爽的 400 常规字重 (Regular)，字迹清秀锐利
   - 已完成事项使用 1px 细致删除线，避免粗墨迹压盖
   - 启用全局高保真次像素抗锯齿平滑渲染
   ======================================================== */
body,
.calendar-container,
.month-calendar,
.calendar-day,
.day-memo-item,
.task-item {
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-rendering: optimizeLegibility !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif !important;
}

/* 日历格中的备忘录条目：统一设定为常规体 400，笔画纤细分明 */
/* ========================================================
   日历格排版全量现代化重构 (Calendar Grid Modern Refinement)
   - 弹性自适应标题 + 责任人微胶囊标签 (Owner Pill Tag)
   - 日历格头部解耦：日期数字、添加按钮与任务数角标互锁排布，零重叠冲突
   - 现代今日指示圆环 (Today Indicator)
   ======================================================== */

/* 1. 日历格头部排版 */
.calendar-day .day-number,
html[data-theme] .calendar-day .day-number {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  margin-bottom: 4px !important;
  position: relative !important;
  min-height: 22px !important;
}

.calendar-day .day-number-text,
html[data-theme] .calendar-day .day-number-text {
  display: inline-block !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  color: var(--ui-text, #1e293b) !important;
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  line-height: 1.2 !important;
  user-select: none !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

/* 今日日期数字指示高亮（自然字色加亮，绝不带任何圆圈或外框） */
.calendar-day.today .day-number-text,
html[data-theme] .calendar-day.today .day-number-text {
  background: transparent !important;
  color: var(--ui-accent, #2563eb) !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-weight: 850 !important;
}

.calendar-day .day-number-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin-left: auto !important;
}

.calendar-day .day-number-actions .day-add {
  opacity: 0;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border: none !important;
  background: var(--ui-accent-soft, rgba(37, 99, 235, 0.12)) !important;
  color: var(--ui-accent, #2563eb) !important;
  font-size: 10px !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
  transform: scale(0.9);
}

.calendar-day:hover .day-number-actions .day-add {
  opacity: 1;
  transform: scale(1);
}

.calendar-day .day-number-actions .day-add:hover {
  background: var(--ui-accent, #2563eb) !important;
  color: #ffffff !important;
  transform: scale(1.15) !important;
}

/* 任务数角标：优雅静态胶囊，杜绝绝对定位重叠 */
.calendar-day .memo-count,
html[data-theme] .calendar-day .memo-count {
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.68rem !important;
  font-weight: 600 !important;
  height: 18px !important;
  min-width: 18px !important;
  padding: 0 5px !important;
  border-radius: 999px !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  background: var(--ui-surface-soft, #f1f5f9) !important;
  color: var(--ui-text-muted, #64748b) !important;
  border: 1px solid var(--ui-border, #e2e8f0) !important;
}

html[data-theme='dark'] .calendar-day .memo-count {
  background: #162035 !important;
  color: #94a3b8 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* 2. 备忘录条目：现代弹性双列排版 */
.calendar-day .day-memo-item,
html[data-theme] .calendar-day .day-memo-item {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  padding: 3px 6px !important;
  font-weight: 400 !important;
  font-size: 0.8125rem !important;
  line-height: 1.38 !important;
  letter-spacing: 0.01em !important;
  border-radius: 6px !important;
}

.calendar-day .day-memo-item .memo-color-dot {
  flex: 0 0 auto !important;
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
}

.calendar-day .day-memo-item .memo-title-text {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-weight: 400 !important;
}

/* 责任人专属微胶囊标签 (Owner Pill Tag) */
.calendar-day .day-memo-item .memo-owner-pill {
  flex: 0 0 auto !important;
  font-size: 0.66rem !important;
  line-height: 1.35 !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
  background: rgba(100, 116, 139, 0.1) !important;
  color: #64748b !important;
  margin-left: auto !important;
  white-space: nowrap !important;
  font-weight: 500 !important;
  letter-spacing: 0.01em !important;
}

html[data-theme='dark'] .calendar-day .day-memo-item .memo-owner-pill {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #94a3b8 !important;
}

/* 已完成条目：仅对标题划线，责任人标签清晰独立，圆点变灰 */
.calendar-day .day-memo-item.completed,
html[data-theme] .calendar-day .day-memo-item.completed {
  opacity: 0.68 !important;
}
.calendar-day .day-memo-item.completed .memo-title-text {
  text-decoration: line-through !important;
  text-decoration-thickness: 1px !important;
  text-decoration-color: rgba(148, 163, 184, 0.75) !important;
}
.calendar-day .day-memo-item.completed .memo-owner-pill {
  opacity: 0.72 !important;
}

/* 已完成条目圆点变灰 (浅色与深色自适应) */
:is(.calendar-day .day-memo-item.completed, .day-memo-item.completed) .memo-color-dot {
  background-color: #94a3b8 !important;
  opacity: 0.7 !important;
}

html[data-theme='dark'] .calendar-day .day-memo-item.completed {
  opacity: 0.62 !important;
}
html[data-theme='dark'] .calendar-day .day-memo-item.completed .memo-title-text {
  color: #64748b !important;
  text-decoration-color: rgba(100, 116, 139, 0.5) !important;
}
html[data-theme='dark'] :is(.calendar-day .day-memo-item.completed, .day-memo-item.completed) .memo-color-dot {
  background-color: #64748b !important;
  opacity: 0.65 !important;
}

/* 详情弹窗中的已完成圆点与划线 */
:is(#dailyDetailModal .task-item.completed, .task-item.completed) .task-color {
  background-color: #94a3b8 !important;
  opacity: 0.7 !important;
}
:is(#dailyDetailModal .task-item.completed, .task-item.completed) .task-title,
:is(#dailyDetailModal .task-item.completed, .task-item.completed) .task-title-text {
  text-decoration: line-through !important;
  opacity: 0.75 !important;
}
:is(#dailyDetailModal .task-item.completed, .task-item.completed) .task-status-pill {
  text-decoration: none !important;
  display: inline-flex !important;
  opacity: 1 !important;
}
html[data-theme='dark'] :is(#dailyDetailModal .task-item.completed, .task-item.completed) .task-color {
  background-color: #64748b !important;
  opacity: 0.65 !important;
}
html[data-theme='dark'] :is(#dailyDetailModal .task-item.completed, .task-item.completed) .task-title,
html[data-theme='dark'] :is(#dailyDetailModal .task-item.completed, .task-item.completed) .task-title-text {
  color: #64748b !important;
}

/* 3. 移动端日历格排版：手机端日期居中且绝对不折行、隐藏右上角加号与数量角标、备忘录展示为极简彩点 */
@media (max-width: 768px) {
  html[data-theme] .calendar-day .day-number,
  .calendar-day .day-number {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: auto !important;
    margin-bottom: 2px !important;
    text-align: center !important;
  }

  html[data-theme] .calendar-day .day-number-text,
  .calendar-day .day-number-text,
  #multiMonthCalendar .day-number-text,
  #multiMonthCalendar .day-number-text[role='button'] {
    display: inline-block !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    text-align: center !important;
    min-width: 0 !important;
    min-height: auto !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    flex-shrink: 0 !important;
  }

  /* 彻底隐藏手机端日历格右上角加号与数量气泡，杜绝横向挤压导致日期数字变成两行 */
  html[data-theme] .calendar-day .day-number-actions,
  .calendar-day .day-number-actions,
  html[data-theme] .calendar-day .memo-count,
  .calendar-day .memo-count,
  html[data-theme] .calendar-day .day-add,
  .calendar-day .day-add {
    display: none !important;
  }

  /* 手机端日历格内条目转为清爽的无边框彩色小圆点 */
  html[data-theme] .calendar-day .day-memo-item,
  .calendar-day .day-memo-item {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: auto !important;
    min-height: auto !important;
    pointer-events: none !important;
  }

  .calendar-day .day-memo-item .memo-title-text,
  .calendar-day .day-memo-item .memo-owner-pill {
    display: none !important;
  }

  .calendar-day .day-memos {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 3px !important;
    max-height: 22px !important;
    overflow: hidden !important;
    width: 100% !important;
    padding: 1px !important;
  }

  .calendar-day .day-memo-item .memo-color-dot {
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    margin: 0 !important;
  }
}

/* ========================================================
   首屏空间垂直高度优化 (Workbench Spacing Compression)
   ======================================================== */
.container {
  max-width: 1440px !important;
  margin: 0 auto !important;
  padding: 12px 20px !important;
  box-sizing: border-box !important;
}

/* 全工作台核心卡片容器左右横向绝对齐平 */
:is(#appTopbar, .workspace-subbar, .team-leaderboard, #dashboardPage, .calendar-container, html[data-theme] #appTopbar.card, html[data-theme] .container .workspace-subbar.card) {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

header.app-topbar {
  margin-bottom: 8px !important;
}

.workspace-subbar {
  margin-bottom: 8px !important;
}

.team-leaderboard {
  border-radius: 12px !important;
  margin-bottom: 12px !important;
}

#dashboardPage {
  border-radius: 12px !important;
  margin-bottom: 12px !important;
}

.calendar-nav-wrap {
  margin: 0 0 6px !important;
}

/* 星期表头与主标题 */
:is(.month-calendar, html[data-theme] .month-calendar) .weekdays div {
  font-weight: 600 !important;
  font-size: 0.82rem !important;
}

:is(#dailyDetailModal, html[data-theme] #dailyDetailModal) .task-title {
  font-weight: 600 !important;
}

/* ========================================================
   弹窗与组件细节升级 (Modals & Controls Modernization)
   ======================================================== */

/* 快捷截止时间预设芯片 (Quick Due Chips) */
.quick-due-chips {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-top: 6px !important;
}

.quick-due-chip {
  border: 1px solid var(--ui-border) !important;
  background: var(--ui-surface-soft) !important;
  color: var(--ui-text-muted) !important;
  font-size: 0.75rem !important;
  padding: 3px 9px !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
}

.quick-due-chip:hover {
  background: var(--ui-surface-hover) !important;
  color: var(--ui-text) !important;
  border-color: var(--ui-accent) !important;
}

.quick-due-chip.active {
  background: var(--ui-accent) !important;
  color: #ffffff !important;
  border-color: var(--ui-accent) !important;
  font-weight: 600 !important;
}

/* 备忘录编辑 Markdown 编辑/预览紧凑切换栏 */
.memo-content-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 6px !important;
}

.memo-tab-switcher {
  display: inline-flex !important;
  background: var(--ui-surface-soft) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 8px !important;
  padding: 2px !important;
  gap: 2px !important;
}

.memo-tab-btn {
  border: none !important;
  background: transparent !important;
  color: var(--ui-text-muted) !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  padding: 3px 10px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.memo-tab-btn.active {
  background: var(--ui-surface) !important;
  color: var(--ui-text) !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

#memoModal #markdownPreview {
  min-height: 120px !important;
  max-height: 200px !important;
  overflow-y: auto !important;
  padding: 10px 14px !important;
  border: 1px solid var(--ui-border-strong) !important;
  border-radius: 9px !important;
  background: var(--ui-surface-soft) !important;
  font-size: 0.88rem !important;
  line-height: 1.6 !important;
}

#memoModal #markdownPreview[hidden],
#memoModal #markdownPreview[style*="display: none"],
#memoModal #markdownPreview.is-hidden {
  display: none !important;
}

/* 全能工具箱：现代胶囊分段选项卡 (Segmented Control Tabs) */
html[data-theme] #functionsModal .tabs {
  display: flex !important;
  gap: 4px !important;
  padding: 4px !important;
  background: var(--ui-surface-soft) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 10px !important;
  margin-bottom: 18px !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}

html[data-theme] #functionsModal .tabs::-webkit-scrollbar {
  display: none !important;
}

html[data-theme] #functionsModal .tab {
  border: none !important;
  background: transparent !important;
  padding: 8px 16px !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  font-size: 0.86rem !important;
  color: var(--ui-text-muted) !important;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
  white-space: nowrap !important;
  cursor: pointer !important;
}

html[data-theme] #functionsModal .tab:hover {
  color: var(--ui-text) !important;
}

html[data-theme] #functionsModal .tab.active {
  background: var(--ui-surface) !important;
  color: var(--ui-accent) !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme='dark'] #functionsModal .tab.active {
  background: #1e293b !important;
  color: #93c5fd !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* 浮动按钮未读提醒呼吸微动效 */
#floatingReminder .badge:not(:empty) {
  animation: badge-pulse 2s infinite ease-in-out;
}

@keyframes badge-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}

/* 全局 Empty State 精致微拟物优化 */
.empty-state {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 32px 18px !important;
  text-align: center !important;
  color: var(--ui-text-muted) !important;
}

.empty-state i {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  background: var(--ui-surface-soft) !important;
  color: var(--ui-accent) !important;
  font-size: 1.25rem !important;
  margin-bottom: 10px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

.empty-state p {
  margin: 0 !important;
  font-size: 0.88rem !important;
  color: var(--ui-text-muted) !important;
}

/* 接收人选择工具栏与快捷操作 */
.task-assignee-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-bottom: 10px !important;
}

.task-assignee-quick-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.btn-assignee-quick {
  background: transparent !important;
  border: 1px solid var(--ui-border) !important;
  color: var(--ui-text-muted) !important;
  font-size: 0.75rem !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.btn-assignee-quick:hover {
  background: var(--ui-surface-soft) !important;
  color: var(--ui-accent) !important;
  border-color: var(--ui-accent) !important;
}

.task-assignee-tags {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  max-height: 140px !important;
  overflow-y: auto !important;
  scrollbar-width: none !important;
}

.task-assignee-tags::-webkit-scrollbar {
  display: none !important;
}

/* ========================================================
   研发大屏 (Dashboard) - 全局与双主题高阶视觉重塑
   ======================================================== */

/* 1. 暗色模式 (Cyber Executive Dashboard) */
html[data-theme='dark'] .dashboard-page,
html.dark .dashboard-page {
  background:
    radial-gradient(circle at 10% 8%, rgba(14, 165, 233, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 92% 12%, rgba(99, 102, 241, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 50% 95%, rgba(20, 184, 166, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #090e1a 0%, #0d1527 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  color: #f1f5f9 !important;
}

html[data-theme='dark'] .dashboard-page::before,
html.dark .dashboard-page::before {
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.04) 1px, transparent 1px) !important;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.08)) !important;
}

html[data-theme='dark'] .dashboard-hero,
html.dark .dashboard-hero {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(26, 38, 64, 0.90) 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.22) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
  color: #f8fafc !important;
}

html[data-theme='dark'] .dashboard-hero::before,
html.dark .dashboard-hero::before {
  background: linear-gradient(180deg, #38bdf8, #818cf8) !important;
}

html[data-theme='dark'] .dashboard-hero::after,
html.dark .dashboard-hero::after {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15), transparent 64%) !important;
}

html[data-theme='dark'] .dashboard-kicker,
html.dark .dashboard-kicker {
  color: #38bdf8 !important;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

html[data-theme='dark'] .kicker-pulse-dot,
html.dark .kicker-pulse-dot {
  background: #38bdf8 !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8) !important;
}

html[data-theme='dark'] #dashboardTitle,
html.dark #dashboardTitle {
  color: #ffffff !important;
  font-weight: 850 !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

html[data-theme='dark'] #dashboardSubtitle,
html.dark #dashboardSubtitle {
  color: #94a3b8 !important;
}

html[data-theme='dark'] .dashboard-actions .btn-secondary,
html.dark .dashboard-actions .btn-secondary {
  background: rgba(30, 41, 59, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme='dark'] .dashboard-actions .btn-secondary:hover,
html.dark .dashboard-actions .btn-secondary:hover {
  background: rgba(45, 60, 88, 0.95) !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
  color: #ffffff !important;
}

html[data-theme='dark'] .dashboard-actions .btn-primary,
html.dark .dashboard-actions .btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb) !important;
  border: 1px solid rgba(56, 189, 248, 0.5) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.4) !important;
}

/* Metric Cards in Dark Mode */
html[data-theme='dark'] .dashboard-metric,
html.dark .dashboard-metric {
  background: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4) !important;
  color: #f1f5f9 !important;
}

html[data-theme='dark'] .dashboard-metric:hover,
html.dark .dashboard-metric:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 16px rgba(56, 189, 248, 0.15) !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
}

html[data-theme='dark'] .dashboard-metric-label,
html.dark .dashboard-metric-label {
  color: #94a3b8 !important;
}

html[data-theme='dark'] .dashboard-metric-value,
html.dark .dashboard-metric-value {
  color: #ffffff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

html[data-theme='dark'] .metric-total.dashboard-metric::before { background: linear-gradient(90deg, #38bdf8, #818cf8) !important; }
html[data-theme='dark'] .metric-total .dashboard-metric-icon { background: rgba(56, 189, 248, 0.16) !important; color: #38bdf8 !important; }
html[data-theme='dark'] .metric-total .dashboard-metric-dot { background: #38bdf8 !important; box-shadow: 0 0 6px #38bdf8 !important; }

html[data-theme='dark'] .metric-success.dashboard-metric::before { background: linear-gradient(90deg, #34d399, #10b981) !important; }
html[data-theme='dark'] .metric-success .dashboard-metric-icon { background: rgba(52, 211, 153, 0.16) !important; color: #34d399 !important; }
html[data-theme='dark'] .metric-success .dashboard-metric-value { color: #34d399 !important; }
html[data-theme='dark'] .metric-success .dashboard-metric-dot { background: #34d399 !important; box-shadow: 0 0 6px #34d399 !important; }

html[data-theme='dark'] .metric-pending.dashboard-metric::before { background: linear-gradient(90deg, #fbbf24, #f59e0b) !important; }
html[data-theme='dark'] .metric-pending .dashboard-metric-icon { background: rgba(251, 191, 36, 0.16) !important; color: #fbbf24 !important; }
html[data-theme='dark'] .metric-pending .dashboard-metric-value { color: #fde68a !important; }
html[data-theme='dark'] .metric-pending .dashboard-metric-dot { background: #fbbf24 !important; box-shadow: 0 0 6px #fbbf24 !important; }

html[data-theme='dark'] .metric-danger.dashboard-metric::before { background: linear-gradient(90deg, #f43f5e, #e11d48) !important; }
html[data-theme='dark'] .metric-danger .dashboard-metric-icon { background: rgba(244, 63, 94, 0.2) !important; color: #f43f5e !important; }
html[data-theme='dark'] .metric-danger .dashboard-metric-value { color: #f43f5e !important; text-shadow: 0 0 10px rgba(244, 63, 94, 0.3) !important; }
html[data-theme='dark'] .metric-danger .dashboard-metric-dot { background: #f43f5e !important; box-shadow: 0 0 8px #f43f5e !important; }

html[data-theme='dark'] .metric-warning.dashboard-metric::before { background: linear-gradient(90deg, #fb923c, #f97316) !important; }
html[data-theme='dark'] .metric-warning .dashboard-metric-icon { background: rgba(251, 146, 60, 0.18) !important; color: #fb923c !important; }
html[data-theme='dark'] .metric-warning .dashboard-metric-value { color: #fb923c !important; }
html[data-theme='dark'] .metric-warning .dashboard-metric-dot { background: #fb923c !important; box-shadow: 0 0 6px #fb923c !important; }

html[data-theme='dark'] .metric-today.dashboard-metric::before { background: linear-gradient(90deg, #818cf8, #6366f1) !important; }
html[data-theme='dark'] .metric-today .dashboard-metric-icon { background: rgba(129, 140, 248, 0.18) !important; color: #818cf8 !important; }
html[data-theme='dark'] .metric-today .dashboard-metric-value { color: #a5b4fc !important; }
html[data-theme='dark'] .metric-today .dashboard-metric-dot { background: #818cf8 !important; box-shadow: 0 0 6px #818cf8 !important; }

html[data-theme='dark'] .metric-safe.dashboard-metric::before { background: linear-gradient(90deg, #94a3b8, #64748b) !important; }
html[data-theme='dark'] .metric-safe .dashboard-metric-icon { background: rgba(148, 163, 184, 0.15) !important; color: #94a3b8 !important; }
html[data-theme='dark'] .metric-safe .dashboard-metric-dot { background: #94a3b8 !important; }

/* Dashboard Cards in Dark Mode */
html[data-theme='dark'] :is(.dashboard-card, #dashboardPage .dashboard-card.card),
html.dark :is(.dashboard-card, #dashboardPage .dashboard-card.card) {
  background: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(12px) !important;
}

html[data-theme='dark'] :is(.dashboard-card-title, #dashboardPage .dashboard-card-title.card-header),
html.dark :is(.dashboard-card-title, #dashboardPage .dashboard-card-title.card-header) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

html[data-theme='dark'] .dashboard-card-title span,
html.dark .dashboard-card-title span {
  color: #ffffff !important;
}

html[data-theme='dark'] .dashboard-card-title i,
html.dark .dashboard-card-title i {
  color: #38bdf8 !important;
}

html[data-theme='dark'] .dashboard-card-title small,
html.dark .dashboard-card-title small {
  color: #94a3b8 !important;
}

/* User Load Rows in Dark Mode */
html[data-theme='dark'] .dashboard-user-row,
html.dark .dashboard-user-row {
  background: rgba(20, 30, 52, 0.65) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  color: #f1f5f9 !important;
}

html[data-theme='dark'] .dashboard-user-row:hover,
html.dark .dashboard-user-row:hover {
  background: rgba(30, 46, 78, 0.9) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme='dark'] .dashboard-user-name,
html.dark .dashboard-user-name {
  color: #ffffff !important;
  font-weight: 800 !important;
}

html[data-theme='dark'] .user-role-tag,
html.dark .user-role-tag {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
}

html[data-theme='dark'] .user-dept-tag,
html.dark .user-dept-tag {
  background: rgba(56, 189, 248, 0.12) !important;
  color: #38bdf8 !important;
}

html[data-theme='dark'] .dashboard-progress,
html.dark .dashboard-progress {
  background: rgba(30, 41, 59, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

html[data-theme='dark'] .dashboard-progress-fill,
html.dark .dashboard-progress-fill {
  background: linear-gradient(90deg, #06b6d4, #3b82f6) !important;
}

html[data-theme='dark'] .fill-complete,
html.dark .fill-complete {
  background: linear-gradient(90deg, #10b981, #059669) !important;
}

html[data-theme='dark'] .fill-overdue,
html.dark .fill-overdue {
  background: linear-gradient(90deg, #f59e0b, #ef4444) !important;
}

html[data-theme='dark'] .stat-pill,
html.dark .stat-pill {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #cbd5e1 !important;
}

html[data-theme='dark'] .pill-completed,
html.dark .pill-completed {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #6ee7b7 !important;
  border: 1px solid rgba(16, 185, 129, 0.28) !important;
}

html[data-theme='dark'] .pill-pending,
html.dark .pill-pending {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fde68a !important;
  border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

html[data-theme='dark'] .pill-overdue.is-alert,
html.dark .pill-overdue.is-alert {
  background: rgba(244, 63, 94, 0.22) !important;
  color: #fecdd3 !important;
  border: 1px solid rgba(244, 63, 94, 0.45) !important;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.2) !important;
}

html[data-theme='dark'] .pill-duesoon.is-alert,
html.dark .pill-duesoon.is-alert {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fde68a !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

html[data-theme='dark'] .dashboard-user-rate,
html.dark .dashboard-user-rate {
  color: #38bdf8 !important;
}

html[data-theme='dark'] .rate-complete,
html.dark .rate-complete {
  color: #34d399 !important;
}

html[data-theme='dark'] .user-rate-label,
html.dark .user-rate-label {
  color: #94a3b8 !important;
}

/* Risk Items in Dark Mode */
html[data-theme='dark'] .dashboard-risk-item,
html.dark .dashboard-risk-item {
  background: rgba(22, 27, 44, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-left: 4px solid #f59e0b !important;
  color: #f1f5f9 !important;
}

html[data-theme='dark'] .dashboard-risk-item:hover,
html.dark .dashboard-risk-item:hover {
  background: rgba(30, 38, 62, 0.9) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme='dark'] .dashboard-risk-item.risk-danger,
html.dark .dashboard-risk-item.risk-danger {
  background: linear-gradient(135deg, rgba(88, 20, 32, 0.7) 0%, rgba(35, 14, 22, 0.8) 100%) !important;
  border: 1px solid rgba(244, 63, 94, 0.35) !important;
  border-left: 4px solid #f43f5e !important;
}

html[data-theme='dark'] .dashboard-risk-item.risk-warning,
html.dark .dashboard-risk-item.risk-warning {
  background: linear-gradient(135deg, rgba(78, 42, 12, 0.6) 0%, rgba(30, 20, 12, 0.7) 100%) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  border-left: 4px solid #f59e0b !important;
}

html[data-theme='dark'] .dashboard-risk-item.risk-muted,
html.dark .dashboard-risk-item.risk-muted {
  background: rgba(20, 29, 47, 0.6) !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  border-left: 4px solid #94a3b8 !important;
}

html[data-theme='dark'] .dashboard-risk-title,
html.dark .dashboard-risk-title {
  color: #ffffff !important;
  font-weight: 750 !important;
}

html[data-theme='dark'] .badge-danger,
html.dark .badge-danger {
  background: #e11d48 !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

html[data-theme='dark'] .badge-warning,
html.dark .badge-warning {
  background: #f59e0b !important;
  color: #0f172a !important;
  border-color: transparent !important;
}

html[data-theme='dark'] .badge-muted,
html.dark .badge-muted {
  background: #475569 !important;
  color: #e2e8f0 !important;
  border-color: transparent !important;
}

html[data-theme='dark'] .dashboard-risk-meta,
html.dark .dashboard-risk-meta {
  color: #cbd5e1 !important;
}

html[data-theme='dark'] .risk-meta-action,
html.dark .risk-meta-action {
  color: #38bdf8 !important;
}

/* Trend Chart in Dark Mode */
html[data-theme='dark'] .dashboard-trend-row:hover,
html.dark .dashboard-trend-row:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

html[data-theme='dark'] .trend-date-col,
html.dark .trend-date-col {
  color: #cbd5e1 !important;
}

html[data-theme='dark'] .trend-week,
html.dark .trend-week {
  color: #94a3b8 !important;
}

html[data-theme='dark'] .today-chip,
html.dark .today-chip {
  background: #0284c7 !important;
  color: #ffffff !important;
}

html[data-theme='dark'] .dashboard-trend-bar,
html.dark .dashboard-trend-bar {
  background: rgba(30, 41, 59, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}

html[data-theme='dark'] .dashboard-trend-fill,
html.dark .dashboard-trend-fill {
  background: linear-gradient(90deg, #06b6d4, #3b82f6) !important;
}

html[data-theme='dark'] .dashboard-trend-fill.fill-all-done,
html.dark .dashboard-trend-fill.fill-all-done {
  background: linear-gradient(90deg, #10b981, #059669) !important;
}

html[data-theme='dark'] .trend-badge,
html.dark .trend-badge {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #94a3b8 !important;
}

html[data-theme='dark'] .trend-badge.badge-done,
html.dark .trend-badge.badge-done {
  background: rgba(56, 189, 248, 0.16) !important;
  color: #38bdf8 !important;
}

html[data-theme='dark'] .trend-badge.badge-all,
html.dark .trend-badge.badge-all {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
}

html[data-theme='dark'] .trend-badge.badge-zero,
html.dark .trend-badge.badge-zero {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #64748b !important;
}

html[data-theme='dark'] .dashboard-empty,
html.dark .dashboard-empty {
  color: #94a3b8 !important;
}

/* 2. 浅色模式 (Crisp Clean Modern SaaS Dashboard) */
html[data-theme='light'] .dashboard-page,
html.light .dashboard-page {
  background:
    radial-gradient(circle at 12% 8%, rgba(14, 165, 233, 0.07), transparent 35%),
    radial-gradient(circle at 92% 10%, rgba(99, 102, 241, 0.06), transparent 35%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06) !important;
  color: #0f172a !important;
}

html[data-theme='light'] .dashboard-hero,
html.light .dashboard-hero {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
  color: #0f172a !important;
}

html[data-theme='light'] .dashboard-kicker,
html.light .dashboard-kicker {
  color: #0284c7 !important;
}

html[data-theme='light'] .kicker-pulse-dot,
html.light .kicker-pulse-dot {
  background: #0284c7 !important;
  box-shadow: 0 0 6px rgba(2, 132, 199, 0.4) !important;
}

html[data-theme='light'] #dashboardTitle,
html.light #dashboardTitle {
  color: #0f172a !important;
  font-weight: 850 !important;
}

html[data-theme='light'] #dashboardSubtitle,
html.light #dashboardSubtitle {
  color: #64748b !important;
}

html[data-theme='light'] .dashboard-actions .btn-secondary,
html.light .dashboard-actions .btn-secondary {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

html[data-theme='light'] .dashboard-actions .btn-secondary:hover,
html.light .dashboard-actions .btn-secondary:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme='light'] .dashboard-actions .btn-primary,
html.light .dashboard-actions .btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb) !important;
  border: 1px solid transparent !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25) !important;
}

html[data-theme='light'] .dashboard-metric,
html.light .dashboard-metric {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme='light'] .dashboard-metric-label,
html.light .dashboard-metric-label {
  color: #64748b !important;
}

html[data-theme='light'] .dashboard-metric-value,
html.light .dashboard-metric-value {
  color: #0f172a !important;
  font-weight: 900 !important;
}

html[data-theme='light'] :is(.dashboard-card, #dashboardPage .dashboard-card.card),
html.light :is(.dashboard-card, #dashboardPage .dashboard-card.card) {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme='light'] :is(.dashboard-card-title, #dashboardPage .dashboard-card-title.card-header),
html.light :is(.dashboard-card-title, #dashboardPage .dashboard-card-title.card-header) {
  border-bottom: 1px solid #f1f5f9 !important;
  color: #0f172a !important;
}

html[data-theme='light'] .dashboard-card-title span,
html.light .dashboard-card-title span {
  color: #0f172a !important;
  font-weight: 800 !important;
}

html[data-theme='light'] .dashboard-card-title small,
html.light .dashboard-card-title small {
  color: #64748b !important;
}

html[data-theme='light'] .dashboard-user-row,
html.light .dashboard-user-row {
  background: #ffffff !important;
  border: 1px solid #f1f5f9 !important;
}

html[data-theme='light'] .dashboard-user-row:hover,
html.light .dashboard-user-row:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme='light'] .dashboard-user-name,
html.light .dashboard-user-name {
  color: #0f172a !important;
}

html[data-theme='light'] .dashboard-user-rate,
html.light .dashboard-user-rate {
  color: #0284c7 !important;
}

html[data-theme='light'] .dashboard-risk-title,
html.light .dashboard-risk-title {
  color: #0f172a !important;
}

html[data-theme='light'] .dashboard-risk-meta,
html.light .dashboard-risk-meta {
  color: #64748b !important;
}

/* Server workbench interactions: keep these overrides outside generated HTML. */
#multiMonthCalendar.grid-1 {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  overflow: visible !important;
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: initial !important;
}

#multiMonthCalendar .day-number-text[role='button'] {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  min-width: 28px;
  min-height: 28px;
  padding: 0 4px;
}

#multiMonthCalendar :is(.day-memo-item, .memo-count, .stat-item) {
  appearance: none;
  font-family: inherit;
  cursor: pointer;
}

#multiMonthCalendar .day-memo-item { text-align: left; }
#multiMonthCalendar :is(.day-number-text[role='button'], .day-memo-item, .memo-count, .stat-item):focus-visible,
:is(.mobile-agenda-item, .toolbar-more summary, .reminder-item):focus-visible {
  outline: 2px solid var(--ui-focus-ring) !important;
  outline-offset: 2px;
}

.toolbar-buttons {
  position: relative !important;
  overflow: visible !important;
}

.toolbar-more {
  position: relative !important;
  flex: 0 0 auto !important;
}

.toolbar-more[open] {
  z-index: 120 !important;
}

/* 数据操作下拉触发按钮：与前三个按钮（新建备忘录、任务发布、研发大屏）保持高度和谐一致 */
.toolbar-more summary,
html[data-theme] .workspace-subbar .toolbar-more summary,
html[data-theme] .workspace-subbar .toolbar-more summary.toolbar-btn {
  list-style: none !important;
  cursor: pointer !important;
  min-height: 39px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 8px 14px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: var(--ui-button-bg) !important;
  color: var(--ui-button-text) !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  transform: none !important;
  user-select: none !important;
  transition: background-color 0.2s ease, opacity 0.2s ease !important;
}

.toolbar-more summary::-webkit-details-marker,
.toolbar-more summary::marker {
  display: none !important;
}

.toolbar-more summary::after {
  content: none !important;
  display: none !important;
}

.toolbar-more summary:hover,
html[data-theme] .workspace-subbar .toolbar-more summary:hover {
  background: var(--ui-button-hover) !important;
  color: var(--ui-button-text) !important;
}

.toolbar-more summary .toolbar-more-caret {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.75rem !important;
  margin-left: 2px !important;
  transition: transform 0.2s ease !important;
}

.toolbar-more[open] summary .toolbar-more-caret {
  transform: rotate(180deg) !important;
}

/* 数据操作下拉浮层：高层叠、精细阴影、平滑动画，绝不被后续卡片遮挡 */
.toolbar-more-menu {
  position: absolute !important;
  z-index: 1000 !important;
  top: calc(100% + 6px) !important;
  right: 0 !important;
  min-width: 175px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  padding: 6px !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 10px !important;
  background: var(--ui-surface) !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
  transform-origin: top right !important;
  animation: toolbarMenuSlideIn 0.18s ease-out !important;
}

@keyframes toolbarMenuSlideIn {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toolbar-more:not([open]) .toolbar-more-menu {
  display: none !important;
}

/* 下拉菜单内的操作项：扁平、高质感、左对齐列表项 */
html[data-theme] .workspace-subbar .toolbar-more-menu :is(#toolbarExport, #toolbarImport),
.toolbar-more-menu .toolbar-btn {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--ui-text) !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  padding: 8px 12px !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  text-align: left !important;
  min-height: 36px !important;
  transform: none !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
}

html[data-theme] .workspace-subbar .toolbar-more-menu :is(#toolbarExport, #toolbarImport):hover,
.toolbar-more-menu .toolbar-btn:hover {
  background: var(--ui-surface-hover) !important;
  color: var(--ui-accent) !important;
}

html[data-theme] .workspace-subbar .toolbar-more-menu #toolbarExport .tabler-icon,
.toolbar-more-menu #toolbarExport i {
  color: var(--ui-success, #2ea043) !important;
}

html[data-theme] .workspace-subbar .toolbar-more-menu #toolbarImport .tabler-icon,
.toolbar-more-menu #toolbarImport i {
  color: var(--ui-accent, #206bc4) !important;
}

.operation-feedback {
  width: 100%;
  padding: 9px 12px;
  margin: 8px 0;
  border: 1px solid var(--red-7);
  border-radius: 8px;
  background: var(--red-3);
  color: var(--red-11);
  white-space: pre-line;
  max-height: 180px;
  overflow: auto;
  font-size: 0.88rem;
}
.operation-feedback[hidden] { display: none !important; }
#memoModal .modal-footer { flex-wrap: wrap; }
#memoSaveFeedback { flex: 1 0 100%; }

/* 自定义日期选择器包装层与日历图标 */
.custom-date-picker-wrap {
  position: relative;
  width: 100%;
}

.custom-date-picker-wrap .custom-date-input {
  cursor: pointer !important;
  padding-right: 38px !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.custom-date-picker-wrap .custom-date-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.75;
  color: var(--ui-accent);
  display: inline-block;
  width: 18px;
  height: 18px;
}

/* 自定义备忘录弹出日历（支持完美暗色模式与浅色模式） */
.memo-calendar-popup {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  max-width: 320px;
  z-index: 2500;
  border-radius: 12px;
  padding: 12px;
  box-sizing: border-box;
  animation: memoCalSlideIn 0.18s ease-out;
}

@keyframes memoCalSlideIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.memo-calendar-popup[hidden] {
  display: none !important;
}

@media (max-width: 768px) {
  .memo-calendar-popup {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    width: 320px !important;
    max-width: calc(100vw - 32px) !important;
    z-index: 99999 !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 0 100vmax rgba(0, 0, 0, 0.5) !important;
    animation: memoCalPopCenter 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  @keyframes memoCalPopCenter {
    from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }
}

.mcp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.mcp-month-label {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.mcp-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  border: 1px solid var(--ui-border);
  background: var(--ui-surface-soft);
  color: var(--ui-text);
  transition: all 0.15s ease;
}

.mcp-nav-btn:hover {
  background: var(--ui-surface-hover);
}

.mcp-today-btn {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
  border: 1px solid var(--ui-border);
  background: var(--ui-surface-soft);
  color: var(--ui-accent);
  transition: all 0.15s ease;
}

.mcp-today-btn:hover {
  background: var(--ui-surface-hover);
}

.mcp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ui-text-muted);
}

.mcp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.mcp-day {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--ui-text);
  cursor: pointer;
  padding: 0;
  user-select: none;
  transition: all 0.15s ease;
}

.mcp-day:hover:not(.mcp-selected) {
  background: var(--ui-surface-hover);
}

.mcp-day.mcp-other-month {
  color: var(--ui-text-muted) !important;
  opacity: 0.45;
}

.mcp-day.mcp-today:not(.mcp-selected) {
  border-color: var(--ui-accent) !important;
  color: var(--ui-accent) !important;
  font-weight: 700;
}

.mcp-day.mcp-selected {
  background: var(--ui-button-bg) !important;
  color: var(--ui-button-text, #ffffff) !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(32, 107, 196, 0.4) !important;
}

/* 时间行：截止时间选择器特有 */
.mcp-time-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--ui-border);
}
.mcp-time-label {
  font-size: 0.78rem;
  color: var(--ui-text-muted, #6c7c8e);
  margin: 0;
  flex-shrink: 0;
}
.mcp-time-input {
  width: 52px;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--ui-border);
  background: var(--ui-input-bg, var(--ui-bg));
  color: var(--ui-text);
  font-size: 0.9rem;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.mcp-time-input::-webkit-inner-spin-button,
.mcp-time-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.mcp-time-sep {
  font-weight: 700;
  color: var(--ui-text);
}
html[data-theme='dark'] .mcp-time-input {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.14) !important;
  color: #fcfdfe !important;
}
html[data-theme='light'] .mcp-time-input {
  background: #f5f7fa !important;
  border-color: #dce1e7 !important;
  color: #182433 !important;
}

.mcp-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--ui-border);
}

.mcp-close-btn {
  padding: 4px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--ui-button-bg);
  color: var(--ui-button-text);
  border: 0;
  cursor: pointer;
}

/* 暗色模式专属深色提升 */
html[data-theme='dark'] .memo-calendar-popup {
  background: var(--ui-surface, #182234) !important;
  border: 1px solid var(--ui-border, #2b3950) !important;
  box-shadow: 0 16px 36px -5px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
  color: var(--ui-text, #fcfdfe) !important;
}

html[data-theme='dark'] .mcp-month-label {
  color: #fcfdfe !important;
}

html[data-theme='dark'] .mcp-today-btn {
  background: rgba(32, 107, 196, 0.18) !important;
  border-color: rgba(32, 107, 196, 0.4) !important;
  color: #70b8ff !important;
}

html[data-theme='dark'] .mcp-today-btn:hover {
  background: rgba(32, 107, 196, 0.3) !important;
}

/* 浅色模式专属细节 */
html[data-theme='light'] .memo-calendar-popup {
  background: #ffffff !important;
  border: 1px solid #dce1e7 !important;
  box-shadow: 0 12px 28px -5px rgba(0, 0, 0, 0.15) !important;
  color: #182433 !important;
}

#reminderList .reminder-group { margin-bottom: 14px; }
#reminderList .reminder-group h3 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 6px;
  color: var(--ui-text);
  font-size: 0.9rem;
}
#reminderList .reminder-item {
  width: 100%;
  display: block;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
#reminderList .reminder-item-details { display: block; }

#mobileAgenda { display: none; }
@media (max-width: 768px) {
  #mobileAgenda {
    display: block;
    padding: 14px;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: var(--ui-surface);
  }
  .mobile-agenda-header, .mobile-agenda-header > div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .mobile-agenda-header { justify-content: space-between; margin-bottom: 10px; }
  .mobile-agenda-kicker, .mobile-agenda-count { color: var(--ui-text-muted); font-size: 0.78rem; }
  .mobile-agenda-header strong { color: var(--ui-text); }
  .mobile-agenda-header .btn { min-height: 36px; }
  .mobile-agenda-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .mobile-agenda-item {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: var(--ui-surface-soft);
    color: var(--ui-text);
    text-align: left;
    cursor: pointer;
    transition: all 0.18s ease;
  }
  .mobile-agenda-item:hover {
    background: var(--ui-surface-hover);
    border-color: var(--ui-border-strong);
  }
  .mobile-agenda-item.completed {
    opacity: 0.78;
    background: var(--ui-surface);
  }
  .mobile-agenda-item.completed strong,
  .mobile-agenda-item strong.completed {
    text-decoration: line-through !important;
    text-decoration-color: var(--ui-text-muted, #94a3b8) !important;
    color: var(--ui-text-muted, #94a3b8) !important;
  }
  .mobile-agenda-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
  .mobile-agenda-item-text { flex: 1; min-width: 0; }
  .mobile-agenda-item-text strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92rem; }
  .mobile-agenda-item-text small { color: var(--ui-text-muted); font-size: 0.75rem; }
  .mobile-agenda-status {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    padding: 3px 9px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    user-select: none !important;
    transition: all 0.15s ease !important;
  }
  .mobile-agenda-status:active {
    transform: scale(0.92);
  }
  .mobile-agenda-status.completed {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
  }
  html[data-theme='dark'] .mobile-agenda-status.completed {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
    border-color: rgba(52, 211, 153, 0.35) !important;
  }
  .mobile-agenda-status.pending {
    background: rgba(59, 130, 246, 0.08) !important;
    color: var(--ui-accent, #3b82f6) !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
  }
  html[data-theme='dark'] .mobile-agenda-status.pending {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
    border-color: rgba(96, 165, 250, 0.25) !important;
  }
  .mobile-agenda-empty {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 30px 16px !important;
    text-align: center !important;
    border-radius: 14px !important;
    background: var(--ui-surface-soft, #f8fafc) !important;
    border: 1px dashed var(--ui-border, #e2e8f0) !important;
    margin: 8px 0 12px !important;
  }
  .mobile-agenda-empty .empty-icon {
    font-size: 2.2rem !important;
    color: var(--ui-accent, #2563eb) !important;
    margin-bottom: 8px !important;
    opacity: 0.75 !important;
  }
  .mobile-agenda-empty .empty-title {
    font-size: 0.94rem !important;
    font-weight: 650 !important;
    color: var(--ui-text, #1e293b) !important;
    margin-bottom: 4px !important;
  }
  .mobile-agenda-empty .empty-sub {
    font-size: 0.8rem !important;
    color: var(--ui-text-muted, #64748b) !important;
  }
  #multiMonthCalendar .calendar-day.agenda-selected { outline: 2px solid var(--ui-accent) !important; outline-offset: -2px; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme] *, html[data-theme] *::before, html[data-theme] *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================================
   提醒中心：多选、一键完成、催办下发现代化交互样式
   ======================================================== */
.reminder-filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.reminder-tab {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--ui-border);
  background: var(--ui-surface-soft);
  color: var(--ui-text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.reminder-tab:hover {
  background: var(--ui-surface-hover);
  color: var(--ui-text);
}

.reminder-tab.active {
  background: var(--ui-accent);
  color: #fff;
  border-color: var(--ui-accent);
}

.reminder-tab .tab-count {
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.75rem;
  font-weight: 600;
}

.reminder-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.reminder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reminder-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-left: 4px solid var(--ui-warning, #f59e0b);
  border-radius: 10px;
  transition: all 0.18s ease;
  cursor: pointer;
  user-select: none;
}

.reminder-item-row:hover {
  background: var(--ui-surface-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.reminder-item-row.is-selected {
  background: rgba(79, 124, 255, 0.08);
  border-color: var(--ui-accent);
  border-left-color: var(--ui-accent);
}

.reminder-item-row.is-overdue {
  border-left-color: var(--ui-danger, #ef4444);
}

.reminder-item-row.is-urged {
  border-left-color: #f97316;
  background: rgba(249, 115, 22, 0.04);
}

.reminder-item-checkbox-label {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
  margin: 0;
  flex: 0 0 auto;
}

.reminder-item-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--ui-accent);
}

.reminder-item-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reminder-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.reminder-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ui-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reminder-badge-urged {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  animation: urgePulse 1.8s infinite ease-in-out;
}

@keyframes urgePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.05); }
}

.reminder-item-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ui-text-muted);
}

.reminder-due-tag {
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.75rem;
  white-space: nowrap;
}

.reminder-due-tag.overdue {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.reminder-due-tag.duesoon {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.reminder-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px 16px !important;
  background: var(--ui-surface-soft) !important;
  border-top: 1px solid var(--ui-border) !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}

.reminder-selection-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reminder-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ui-text);
  margin: 0;
  user-select: none;
}

.reminder-select-all-label input {
  width: 17px;
  height: 17px;
  accent-color: var(--ui-accent);
  cursor: pointer;
}

.reminder-selected-count {
  font-size: 0.82rem;
  color: var(--ui-text-muted);
}

.reminder-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reminder-btn-group .btn {
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.reminder-btn-group .btn-warning {
  background: #f59e0b;
  color: #fff;
}
.reminder-btn-group .btn-warning:hover {
  background: #d97706;
}

.reminder-btn-group .btn-success {
  background: #10b981;
  color: #fff;
}
.reminder-btn-group .btn-success:hover {
  background: #059669;
}

/* 工程师客户端催办浮动通知条 */
.engineer-urge-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  padding: 10px 18px;
  border-radius: 30px;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  animation: bannerSlideDown 0.35s ease, bannerPulse 2.5s infinite;
  max-width: 90vw;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  backdrop-filter: blur(8px);
}

.engineer-urge-banner:hover {
  transform: translateX(-50%) translateY(-2px);
}

.engineer-urge-banner.banner-praise {
  background: linear-gradient(135deg, #059669, #0284c7);
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.25);
  animation: bannerSlideDown 0.35s ease, bannerPulsePraise 2.5s infinite;
}

@keyframes bannerSlideDown {
  from { transform: translate(-50%, -40px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
@keyframes bannerPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 8px 32px rgba(239, 68, 68, 0.7); }
}
@keyframes bannerPulsePraise {
  0%, 100% { box-shadow: 0 8px 24px rgba(5, 150, 105, 0.4); }
  50% { box-shadow: 0 8px 32px rgba(2, 132, 199, 0.6); }
}

.engineer-urge-banner .close-banner {
  background: rgba(255, 255, 255, 0.25);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  margin-left: 6px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.engineer-urge-banner .close-banner:hover {
  background: rgba(255, 255, 255, 0.45);
  transform: scale(1.1);
}

/* ── 审阅与点赞：日历事项强高亮边框效果 ───────────── */
.memo-praise-highlight {
  position: relative !important;
  z-index: 60 !important;
  border-radius: 6px !important;
  animation: memoPraiseFlash 3.6s ease-in-out forwards !important;
  pointer-events: auto !important;
}

@keyframes memoPraiseFlash {
  0%   { box-shadow: none; }
  10%  { outline: 2.5px solid #10b981; outline-offset: -2px;
         background-color: #d1fae5; border-left-color: #059669;
         box-shadow: inset 0 0 0 2px #10b981, 0 2px 10px rgba(16,185,129,0.45); }
  22%  { outline: 2.5px solid #f59e0b; outline-offset: -2px;
         background-color: #fef3c7; border-left-color: #d97706;
         box-shadow: inset 0 0 0 2px #f59e0b, 0 2px 10px rgba(245,158,11,0.5); }
  36%  { outline: 3px solid #10b981; outline-offset: -2px;
         background-color: #d1fae5; border-left-color: #059669;
         box-shadow: inset 0 0 0 2.5px #10b981, 0 3px 12px rgba(16,185,129,0.55); }
  50%  { outline: 2.5px solid #f59e0b; outline-offset: -2px;
         background-color: #fef3c7; border-left-color: #d97706;
         box-shadow: inset 0 0 0 2px #f59e0b, 0 2px 10px rgba(245,158,11,0.45); }
  64%  { outline: 3px solid #10b981; outline-offset: -2px;
         background-color: #d1fae5; border-left-color: #059669;
         box-shadow: inset 0 0 0 2.5px #10b981, 0 3px 12px rgba(16,185,129,0.5); }
  78%  { outline: 2.5px solid #f59e0b; outline-offset: -2px;
         background-color: #fef3c7; border-left-color: #d97706;
         box-shadow: inset 0 0 0 2px #f59e0b, 0 2px 8px rgba(245,158,11,0.35); }
  90%  { outline: 2px solid #10b981; outline-offset: -1px;
         background-color: #ecfdf5;
         box-shadow: inset 0 0 0 1.5px #10b981; }
  100% { outline: none; background-color: inherit; box-shadow: none; }
}

html[data-theme='dark'] .memo-praise-highlight {
  animation: memoPraiseFlashDark 3.6s ease-in-out forwards !important;
}

@keyframes memoPraiseFlashDark {
  0%   { box-shadow: none; }
  10%  { outline: 2.5px solid #34d399; outline-offset: -2px;
         background-color: #064e3b; border-left-color: #34d399;
         box-shadow: inset 0 0 0 2px #34d399, 0 2px 10px rgba(52,211,153,0.5); }
  22%  { outline: 2.5px solid #fbbf24; outline-offset: -2px;
         background-color: #451a03; border-left-color: #fbbf24;
         box-shadow: inset 0 0 0 2px #fbbf24, 0 2px 10px rgba(251,191,36,0.5); }
  36%  { outline: 3px solid #34d399; outline-offset: -2px;
         background-color: #064e3b; border-left-color: #34d399;
         box-shadow: inset 0 0 0 2.5px #34d399, 0 3px 12px rgba(52,211,153,0.55); }
  50%  { outline: 2.5px solid #fbbf24; outline-offset: -2px;
         background-color: #451a03; border-left-color: #fbbf24;
         box-shadow: inset 0 0 0 2px #fbbf24, 0 2px 10px rgba(251,191,36,0.45); }
  64%  { outline: 3px solid #34d399; outline-offset: -2px;
         background-color: #064e3b; border-left-color: #34d399;
         box-shadow: inset 0 0 0 2.5px #34d399, 0 3px 12px rgba(52,211,153,0.5); }
  78%  { outline: 2.5px solid #fbbf24; outline-offset: -2px;
         background-color: #451a03;
         box-shadow: inset 0 0 0 2px #fbbf24, 0 2px 8px rgba(251,191,36,0.35); }
  90%  { outline: 2px solid #34d399; outline-offset: -1px;
         background-color: #052e16;
         box-shadow: inset 0 0 0 1.5px #34d399; }
  100% { outline: none; background-color: inherit; box-shadow: none; }
}

/* 日历格子强高亮边框波纹 */
.calendar-day-praise-flash {
  animation: dayPraiseGlow 3.6s ease-in-out forwards !important;
  position: relative !important;
  z-index: 5 !important;
}

@keyframes dayPraiseGlow {
  0%   { box-shadow: none; }
  10%  { box-shadow: inset 0 0 0 3px rgba(16,185,129,0.9), 0 0 16px rgba(16,185,129,0.5);
         background-color: rgba(16,185,129,0.1); }
  22%  { box-shadow: inset 0 0 0 3px rgba(245,158,11,0.9), 0 0 18px rgba(245,158,11,0.55);
         background-color: rgba(245,158,11,0.1); }
  36%  { box-shadow: inset 0 0 0 4px rgba(16,185,129,0.95), 0 0 22px rgba(16,185,129,0.6);
         background-color: rgba(16,185,129,0.12); }
  50%  { box-shadow: inset 0 0 0 3px rgba(245,158,11,0.9), 0 0 18px rgba(245,158,11,0.5);
         background-color: rgba(245,158,11,0.1); }
  64%  { box-shadow: inset 0 0 0 4px rgba(16,185,129,0.9), 0 0 18px rgba(16,185,129,0.55);
         background-color: rgba(16,185,129,0.1); }
  80%  { box-shadow: inset 0 0 0 2px rgba(16,185,129,0.6);
         background-color: rgba(16,185,129,0.05); }
  100% { box-shadow: none; background-color: inherit; }
}

html[data-theme='dark'] .calendar-day-praise-flash {
  animation: dayPraiseGlowDark 3.6s ease-in-out forwards !important;
}

@keyframes dayPraiseGlowDark {
  0%   { box-shadow: none; }
  10%  { box-shadow: inset 0 0 0 3px rgba(52,211,153,0.9), 0 0 16px rgba(52,211,153,0.55);
         background-color: rgba(52,211,153,0.14); }
  22%  { box-shadow: inset 0 0 0 3px rgba(251,191,36,0.9), 0 0 18px rgba(251,191,36,0.55);
         background-color: rgba(251,191,36,0.12); }
  36%  { box-shadow: inset 0 0 0 4px rgba(52,211,153,0.95), 0 0 24px rgba(52,211,153,0.65);
         background-color: rgba(52,211,153,0.16); }
  50%  { box-shadow: inset 0 0 0 3px rgba(251,191,36,0.9), 0 0 18px rgba(251,191,36,0.5);
         background-color: rgba(251,191,36,0.12); }
  64%  { box-shadow: inset 0 0 0 4px rgba(52,211,153,0.9), 0 0 20px rgba(52,211,153,0.6);
         background-color: rgba(52,211,153,0.14); }
  80%  { box-shadow: inset 0 0 0 2px rgba(52,211,153,0.6);
         background-color: rgba(52,211,153,0.07); }
  100% { box-shadow: none; background-color: inherit; }
}


/* 多事项导航浮层 */
#praisePager {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8888;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #059669, #0284c7);
  color: #fff;
  padding: 8px 16px;
  border-radius: 30px;
  box-shadow: 0 6px 24px rgba(5,150,105,0.45), 0 2px 8px rgba(0,0,0,0.15);
  font-size: 0.85rem;
  font-weight: 600;
  animation: praisePagerIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
  user-select: none;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
}

@keyframes praisePagerIn {
  from { transform: translateX(-50%) translateY(30px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);   opacity: 1; }
}

#praisePager.pager-out {
  animation: praisePagerOut 0.25s ease forwards;
}
@keyframes praisePagerOut {
  to { transform: translateX(-50%) translateY(30px); opacity: 0; }
}

#praisePager button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s ease, transform 0.1s ease;
}
#praisePager button:hover { background: rgba(255,255,255,0.4); transform: scale(1.1); }
#praisePager button:disabled { opacity: 0.35; cursor: default; transform: none; }
#praisePager .pager-label { padding: 0 4px; letter-spacing: 0.02em; }
#praisePager .pager-close {
  background: rgba(255,255,255,0.18);
  border: none; color: #fff;
  border-radius: 50%;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  margin-left: 2px;
  transition: background 0.15s ease;
}
#praisePager .pager-close:hover { background: rgba(255,255,255,0.4); }


/* ── 桌面端任务悬浮卡片 (Memo Hover Tooltip) ───────────── */
.memo-hover-tooltip {
  position: fixed;
  z-index: 99999;
  pointer-events: none !important;
  visibility: hidden !important;
  width: 290px;
  max-width: calc(100vw - 32px);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  box-shadow: 0 14px 35px -5px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--ui-border);
  background: var(--ui-surface, #ffffff);
  color: var(--ui-text, #1e293b);
  border: 1px solid var(--ui-border, #e2e8f0);
  transition: opacity 0.12s cubic-bezier(0.16, 1, 0.3, 1), transform 0.12s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0 !important;
  transform: scale(0.96) translateY(4px);
  cursor: pointer;
}
.memo-hover-tooltip.visible {
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: scale(1) translateY(0);
}
.mht-header {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.mht-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.mht-title {
  flex: 1;
  word-break: break-all;
  color: var(--ui-text);
  line-height: 1.35;
}
.mht-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--ui-text-muted, #64748b);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--ui-border);
  flex-wrap: wrap;
}
.mht-badge {
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.72rem;
}
.mht-badge.completed { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.mht-badge.pending { background: rgba(37, 99, 235, 0.15); color: #3b82f6; }
.mht-content {
  margin-top: 5px;
  font-size: 0.76rem;
  color: var(--ui-text-muted, #64748b);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.mht-stamp {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 2px;
}
.mht-stamp.read {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}
.mht-stamp.like {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}
.mht-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--ui-border, #e2e8f0);
}
.mht-btn-carryover {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mht-btn-carryover:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
  transform: translateY(-1px);
}
.mht-btn-carryover:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none !important;
}
.mht-btn-carryover.success {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}
.mht-react-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mht-btn-react {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid var(--ui-border, #e2e8f0);
  background: var(--ui-surface, #ffffff);
  color: var(--ui-text-muted, #64748b);
  transition: all 0.15s ease;
}
.mht-btn-react:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}
.mht-btn-react.active {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.4);
}
.mht-btn-react[data-action="toggle-like"].active {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.4);
}

html[data-theme='dark'] .memo-hover-tooltip {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 14px 35px -5px rgba(0, 0, 0, 0.6), 0 0 0 1px #334155 !important;
  color: #f1f5f9 !important;
}
html[data-theme='dark'] .mht-title {
  color: #f8fafc !important;
}
html[data-theme='dark'] .mht-content {
  color: #cbd5e1 !important;
}
html[data-theme='dark'] .mht-meta,
html[data-theme='dark'] .mht-actions-bar {
  border-color: #334155 !important;
}
html[data-theme='dark'] .mht-btn-carryover {
  color: #34d399 !important;
  background: rgba(52, 211, 153, 0.15) !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
}
html[data-theme='dark'] .mht-btn-carryover:hover {
  background: #10b981 !important;
  color: #ffffff !important;
}
html[data-theme='dark'] .mht-btn-react {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

/* ── 全局悬浮气泡通知 (轻量无感 Toast) ──────────────── */
.global-toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.global-toast-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.35), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  animation: toastFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.global-toast-item.success i {
  color: #34d399;
}
.global-toast-item.error i {
  color: #f87171;
}
.global-toast-item.info i {
  color: #60a5fa;
}
.global-toast-item.fade-out {
  animation: toastFadeOut 0.22s forwards;
}
@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastFadeOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(0.95); }
}

/* ── 移动端日程聚焦脉冲动画 ────────────────────────── */
@keyframes agendaPulse {
  0% { box-shadow: 0 0 0 0 rgba(32, 107, 196, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(32, 107, 196, 0); }
  100% { box-shadow: none; }
}
.mobile-agenda.agenda-pulse {
  animation: agendaPulse 0.6s ease-out;
}

/* ── 每日详情弹窗任务项徽章与快速勾选 ──────────────── */
.task-item {
  position: relative;
  transition: transform 0.1s ease, border-color 0.2s ease;
}
.task-status-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}
.task-status-pill.completed {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}
.task-status-pill.pending {
  background: rgba(37, 99, 235, 0.15);
  color: #3b82f6;
}
.task-time-exact {
  font-weight: 500;
  color: var(--ui-text, #334155);
  margin-left: 4px;
}
html[data-theme='dark'] .task-time-exact {
  color: #cbd5e1;
}

/* ── 月历卡片头部“周计划与周报”全屏工作台入口按钮 ────────── */
.calendar-weekly-plan-btn {
  background: linear-gradient(135deg, #4361ee, #3a0ca3);
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.86rem;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 2px 8px rgba(67, 97, 238, 0.25);
}

.calendar-weekly-plan-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4);
  filter: brightness(1.06);
}

.calendar-weekly-plan-btn:active {
  transform: translateY(0);
}

/* ── 周计划全屏独立工作台 (Weekly Plan Page) ────────── */
.weekly-plan-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 20px;
  min-height: calc(100vh - 80px);
  animation: wpFadeIn 0.2s ease-out;
}

@keyframes wpFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 顶部工作台导航卡片 (极简单行排布) */
.wp-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--ui-surface, #ffffff);
  border: 1px solid var(--ui-border, #e2e8f0);
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: var(--ui-shadow, 0 2px 8px rgba(0, 0, 0, 0.04));
}

.wp-hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wp-back-btn {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid var(--ui-border, #cbd5e1);
  background: var(--ui-surface-soft, #f8fafc);
  color: var(--ui-text, #1e293b);
  transition: all 0.15s ease;
}

.wp-back-btn:hover {
  background: var(--ui-border, #e2e8f0);
  transform: translateX(-2px);
}

.wp-hero-title-box {
  display: flex;
  align-items: center;
}

.wp-hero-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ui-text, #0f172a);
  display: flex;
  align-items: center;
  gap: 6px;
}

.wp-hero-center {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wp-week-nav-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ui-surface-soft, #f8fafc);
  border: 1px solid var(--ui-border, #e2e8f0);
  border-radius: 8px;
  padding: 3px 6px;
}

.wp-nav-arrow-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--ui-border, #cbd5e1);
  background: var(--ui-surface, #ffffff);
  color: var(--ui-text, #1e293b);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wp-nav-arrow-btn:hover {
  background: var(--ui-border, #e2e8f0);
}

.wp-current-week-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ui-text, #0f172a);
  padding: 0 6px;
  white-space: nowrap;
}

.wp-today-chip {
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}

/* 顶部紧凑指标胶囊群（取代臃肿大卡片） */
.wp-hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.wp-stat-chip {
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 6px;
  background: var(--ui-surface-soft, #f8fafc);
  border: 1px solid var(--ui-border, #e2e8f0);
  color: var(--ui-text, #1e293b);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wp-stat-chip strong {
  font-weight: 700;
}

.wp-stat-chip.done {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.25);
}

.wp-stat-chip.pending {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.25);
}

.wp-stat-chip.rate {
  background: rgba(67, 97, 238, 0.08);
  color: #4361ee;
  border-color: rgba(67, 97, 238, 0.25);
}

.wp-stat-chip.next {
  background: rgba(2, 132, 199, 0.08);
  color: #0284c7;
  border-color: rgba(2, 132, 199, 0.25);
}

.wp-hero-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wp-view-toggle-wrap {
  display: inline-flex;
  background: var(--ui-surface-soft, #f1f5f9);
  padding: 3px;
  border-radius: 8px;
  gap: 4px;
  border: 1px solid var(--ui-border, #e2e8f0);
}

.wp-view-toggle-wrap .btn {
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--ui-text-muted, #64748b);
  transition: all 0.15s ease;
}

.wp-view-toggle-wrap .btn.active {
  background: var(--ui-surface, #ffffff);
  color: var(--ui-primary, #4361ee);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

#wpPageCopyReportBtn {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}

#wpPageCopyReportBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
}

#wpPageRefreshBtn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ── 待办流转提醒通知栏 (有待办时优雅浮现，平时不占空间) ────────── */
.wp-rollover-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: wpFadeIn 0.2s ease-out;
}

.wp-rollover-banner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.wp-rollover-banner-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wp-rollover-batch-btn {
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 6px;
  background: #d97706;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s ease;
}

.wp-rollover-batch-btn:hover {
  background: #b45309;
}

.wp-rollover-banner-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wp-rollover-banner-chip {
  background: #ffffff;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.wp-chip-name {
  font-size: 0.76rem;
  font-weight: 600;
  color: #78350f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wp-chip-action-btn {
  padding: 2px 7px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  background: #206bc4;
  color: #ffffff;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: background 0.15s ease;
}

.wp-chip-action-btn:hover {
  background: #17549c;
}

/* ── 7天周看板网格容器 (100% 满宽排布) ────────── */
.wp-board-container {
  width: 100%;
}

.wp-columns-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.wp-day-column {
  background: var(--ui-surface, #ffffff);
  border: 1px solid var(--ui-border, #e2e8f0);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 165px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.wp-day-column:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.wp-day-column.is-today {
  border: 2px solid var(--ui-primary, #4361ee);
  background: rgba(67, 97, 238, 0.015);
}

.wp-day-column.is-today .wp-day-col-header {
  background: linear-gradient(180deg, rgba(67, 97, 238, 0.08) 0%, rgba(67, 97, 238, 0.02) 100%);
  border-bottom-color: rgba(67, 97, 238, 0.2);
}

.wp-day-col-header {
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--ui-border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ui-surface-soft, #f8fafc);
}

.wp-day-date-box {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.wp-day-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ui-text, #0f172a);
}

.wp-day-date {
  font-size: 0.72rem;
  color: var(--ui-text-muted, #64748b);
}

.wp-today-badge {
  font-size: 0.66rem;
  font-weight: 700;
  background: var(--ui-primary, #4361ee);
  color: #ffffff;
  border-radius: 4px;
  padding: 1px 5px;
}

.wp-day-count-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ui-text-muted, #64748b);
  background: var(--ui-surface, #ffffff);
  border: 1px solid var(--ui-border, #e2e8f0);
  border-radius: 999px;
  padding: 1px 6px;
}

/* 顶部快速录入框（直接处于日期下方，无需下翻） */
.wp-day-quick-add {
  padding: 8px;
  border-bottom: 1px solid var(--ui-border, #f1f5f9);
  background: var(--ui-surface, #ffffff);
}

.wp-day-input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--ui-border, #cbd5e1);
  font-size: 0.76rem;
  outline: none;
  background: var(--ui-surface-soft, #f8fafc);
  color: var(--ui-text, #1e293b);
  transition: all 0.15s ease;
}

.wp-day-input:focus {
  background: #ffffff;
  border-color: var(--ui-primary, #4361ee);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.15);
}

/* 任务列表滚动区域 */
.wp-day-task-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
}

.wp-day-empty {
  text-align: center;
  color: var(--ui-text-muted, #94a3b8);
  font-size: 0.74rem;
  padding: 28px 4px;
}

.wp-day-task-card {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--ui-border, #e2e8f0);
  border-left-width: 3px;
  background: var(--ui-surface-soft, #f8fafc);
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.wp-day-task-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.wp-day-task-card.completed {
  opacity: 0.7;
  background: rgba(16, 185, 129, 0.03);
}

.wp-day-card-top {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.wp-day-checkbox {
  margin-top: 3px;
  cursor: pointer;
  accent-color: var(--ui-primary, #4361ee);
}

.wp-day-card-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ui-text, #0f172a);
  cursor: pointer;
  flex: 1;
  word-break: break-all;
  line-height: 1.3;
}

.wp-day-card-title.completed {
  text-decoration: line-through;
  color: var(--ui-text-muted, #94a3b8);
}

.wp-day-card-content {
  font-size: 0.71rem;
  color: var(--ui-text-muted, #64748b);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wp-day-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--ui-text-muted, #94a3b8);
}

.wp-day-card-due {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.wp-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wp-icon-btn {
  border: none;
  background: transparent;
  padding: 2px 4px;
  font-size: 0.7rem;
  color: var(--ui-text-muted, #64748b);
  cursor: pointer;
  border-radius: 4px;
}

.wp-icon-btn:hover {
  color: var(--ui-primary, #4361ee);
  background: rgba(0, 0, 0, 0.05);
}

/* 团队视图矩阵 */
.team-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.team-plan-card {
  border-radius: 12px;
  border: 1px solid var(--ui-border, #e2e8f0);
  background: var(--ui-surface-soft, #f8fafc);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.team-plan-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ui-border, #e2e8f0);
}

/* 暗色主题适配 (Dark Mode) */
html[data-theme='dark'] .calendar-weekly-plan-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}
html[data-theme='dark'] .wp-hero-card,
html[data-theme='dark'] .wp-day-column {
  background: #1e293b;
  border-color: #334155;
}
html[data-theme='dark'] .wp-hero-title,
html[data-theme='dark'] .wp-day-name,
html[data-theme='dark'] .wp-day-card-title {
  color: #f1f5f9;
}
html[data-theme='dark'] .wp-day-col-header,
html[data-theme='dark'] .wp-day-quick-add,
html[data-theme='dark'] .wp-week-nav-bar,
html[data-theme='dark'] .wp-view-toggle-wrap {
  background: #0f172a;
  border-color: #334155;
}
html[data-theme='dark'] .wp-day-task-card,
html[data-theme='dark'] .team-plan-card {
  background: #0f172a;
  border-color: #334155;
}
html[data-theme='dark'] .wp-back-btn,
html[data-theme='dark'] .wp-nav-arrow-btn,
html[data-theme='dark'] .wp-day-input {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}
html[data-theme='dark'] .wp-current-week-label {
  background: transparent !important;
  border: none !important;
  color: #f1f5f9 !important;
}
html[data-theme='dark'] .wp-view-toggle-wrap .btn.active {
  background: #1e293b;
  color: #60a5fa;
}
html[data-theme='dark'] .wp-day-count-badge {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}
html[data-theme='dark'] .wp-hero-stats {
  background: #0f172a;
  border-color: #334155;
}
html[data-theme='dark'] .wp-stat-chip {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}
html[data-theme='dark'] .wp-stat-chip.total i {
  color: #38bdf8;
}
html[data-theme='dark'] .wp-stat-chip.done {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}
html[data-theme='dark'] .wp-stat-chip.pending {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}
html[data-theme='dark'] .wp-stat-chip.rate {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}
html[data-theme='dark'] .wp-stat-chip.next {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}
html[data-theme='dark'] .wp-rollover-banner {
  background: #2d2410;
  border-color: #78350f;
}
html[data-theme='dark'] .wp-rollover-banner-title {
  color: #fde68a;
}
html[data-theme='dark'] .wp-rollover-banner-chip {
  background: #1e293b;
  border-color: #78350f;
}
html[data-theme='dark'] .wp-chip-name {
  color: #fde68a;
}

/* 响应式适配 (Responsive Media Queries) */
@media (max-width: 1200px) {
  .wp-columns-grid {
    grid-template-columns: repeat(7, minmax(135px, 1fr));
    overflow-x: auto;
    padding-bottom: 6px;
  }
}
@media (max-width: 768px) {
  .weekly-plan-page {
    padding: 8px 4px;
    gap: 10px;
  }
  .wp-hero-card {
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  }
  .wp-hero-left {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }
  .wp-hero-title-box {
    order: 1;
    min-width: 0;
  }
  .wp-back-btn {
    order: 2;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 10px;
  }
  .wp-hero-title {
    font-size: 1.05rem;
    white-space: nowrap;
  }
  .wp-hero-center {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .wp-week-nav-bar {
    width: 100%;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 32px auto;
    align-items: center;
    gap: 6px;
    padding: 5px;
  }
  .wp-nav-arrow-btn {
    width: 32px;
    height: 32px;
  }
  .wp-today-chip {
    min-height: 32px;
    padding: 0 8px;
  }
  .hide-mobile {
    display: none !important;
  }
  .wp-hero-stats {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    padding: 8px 6px;
    border: 1px solid var(--ui-border, #e2e8f0);
    border-radius: 10px;
    background: var(--ui-surface-soft, #f8fafc);
    box-sizing: border-box;
  }
  .wp-hero-stats .wp-stat-chip {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 2px 3px;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
    white-space: nowrap;
    font-size: 0.73rem;
    font-weight: 600;
  }
  .wp-hero-stats .wp-stat-chip:not(:last-child) {
    border-right: 1px solid var(--ui-border, #e2e8f0) !important;
  }
  html[data-theme='dark'] .wp-hero-stats .wp-stat-chip:not(:last-child) {
    border-right-color: #334155 !important;
  }
  .wp-current-week-label {
    font-size: 0.78rem;
    line-height: 1.3;
    padding: 0;
    text-align: center;
    white-space: normal;
    background: transparent !important;
    border: none !important;
  }
  .wp-hero-right {
    width: 100%;
    justify-content: flex-start;
    align-items: stretch;
    gap: 8px;
  }
  .wp-view-toggle-wrap {
    flex: 0 0 100%;
    width: 100%;
  }
  .wp-view-toggle-wrap .btn {
    flex: 1 1 0;
    justify-content: center;
    min-height: 34px;
  }
  #wpPageGoalsBtn,
  #wpPageCopyReportBtn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 38px;
    justify-content: center;
    padding: 6px 8px;
    white-space: nowrap;
    font-size: 0.78rem;
  }
  #wpPageRefreshBtn {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
  }
  .calendar-weekly-plan-btn {
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    font-size: 0.78rem;
  }
  .wp-columns-grid {
    grid-template-columns: repeat(7, minmax(160px, 1fr));
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  .wp-day-column {
    min-height: 440px;
    scroll-snap-align: start;
  }
  .wp-day-date-box {
    white-space: nowrap;
  }
}

/* ── 周计划：顶部里程碑目标栏 (极简单行，不挤压看板高度) ────────── */
.wp-milestone-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: var(--ui-surface, #ffffff);
  border: 1px solid var(--ui-border, #e2e8f0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  cursor: pointer;
  transition: all 0.15s ease;
}

.wp-milestone-bar:hover {
  border-color: var(--ui-primary, #4361ee);
  box-shadow: 0 3px 8px rgba(67, 97, 238, 0.08);
}

.wp-milestone-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.wp-milestone-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--ui-text, #1e293b);
}

.wp-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(67, 97, 238, 0.09);
  color: var(--ui-primary, #4361ee);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.wp-pill-badge.deliverable {
  background: rgba(16, 185, 129, 0.09);
  color: #059669;
}

.wp-pill-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.wp-milestone-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--ui-border, #e2e8f0);
  background: var(--ui-surface-soft, #f8fafc);
  color: var(--ui-text-muted, #64748b);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.wp-milestone-btn:hover {
  background: var(--ui-surface, #ffffff);
  color: var(--ui-primary, #4361ee);
  border-color: var(--ui-primary, #4361ee);
}

.wp-milestone-bar.is-empty {
  background: var(--ui-surface-soft, #f8fafc);
  border: 1px dashed var(--ui-border, #cbd5e1);
  padding: 7px 14px;
}

.wp-milestone-empty-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ui-text-muted, #64748b);
}

.wp-milestone-empty-icon {
  color: var(--ui-primary, #4361ee);
}

.wp-milestone-set-btn {
  border: 0;
  background: transparent;
  color: var(--ui-primary, #4361ee);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.12s ease;
}

.wp-milestone-set-btn:hover {
  background: rgba(67, 97, 238, 0.08);
}

/* ── 目标互锁：未设目标时的锁定 CTA 横幅 ────────────────── */
.wp-goal-lock-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
  border: 1.5px solid #fbbf24;
  border-radius: 12px;
  margin-bottom: 12px;
}
.wp-goal-lock-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.wp-goal-lock-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #b45309;
  flex-shrink: 0;
}
.wp-goal-lock-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wp-goal-lock-text strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: #92400e;
}
.wp-goal-lock-text span {
  font-size: 0.78rem;
  color: #b45309;
}
.wp-goal-set-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
  transition: transform 0.12s, box-shadow 0.12s;
}
.wp-goal-set-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45);
}

/* ── 锁定的每日计划添加区 ─────────────────────────────── */
.wp-day-quick-add.is-locked {
  background: var(--ui-bg, #f8fafc);
  border-radius: 8px;
}
.wp-day-locked-hint {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  background: transparent;
  border: 1.5px dashed var(--ui-border, #e2e8f0);
  border-radius: 8px;
  color: var(--ui-text-muted, #94a3b8);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.wp-day-locked-hint:hover {
  border-color: #f59e0b;
  color: #d97706;
}
.wp-day-locked-hint .fas {
  font-size: 0.7rem;
}

/* ── 全员看板重设计 ──────────────────────────────────── */
.wp-team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 22px;
  background: var(--ui-surface, #ffffff);
  border: 1px solid var(--ui-border, #e2e8f0);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.wp-team-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.wp-team-header-left > .fas {
  font-size: 1.5rem;
  color: var(--tblr-primary, #4361ee);
}
.wp-team-header-left h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ui-text, #1e293b);
}
.wp-team-header-left span {
  font-size: 0.78rem;
  color: var(--ui-text-muted, #64748b);
}
.wp-team-header-stats {
  display: flex;
  gap: 24px;
}
.wp-team-hstat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.wp-team-hstat span {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ui-text, #1e293b);
  line-height: 1;
}
.wp-team-hstat small {
  font-size: 0.7rem;
  color: var(--ui-text-muted, #64748b);
}

/* 团队看板卡片网格 */
.wp-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.wp-team-card {
  background: var(--ui-surface, #ffffff);
  border: 1px solid var(--ui-border, #e2e8f0);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: box-shadow 0.15s, transform 0.15s;
}
.wp-team-card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.wp-team-card.wp-team-status-has-overdue {
  border-top: 3px solid #ef4444;
}
.wp-team-card.wp-team-status-all-done {
  border-top: 3px solid #10b981;
}
.wp-team-card.wp-team-status-no-goal {
  border-top: 3px solid #94a3b8;
}
.wp-team-card.wp-team-status-in-progress {
  border-top: 3px solid #4361ee;
}

/* 卡片头部：头像 + 用户信息 + 状态 */
.wp-team-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wp-team-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.wp-team-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wp-team-user-info strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ui-text, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wp-team-user-info span {
  font-size: 0.72rem;
  color: var(--ui-text-muted, #64748b);
}
.wp-team-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.wp-team-status-badge.wp-team-status-no-goal {
  background: #f1f5f9; color: #64748b;
}
.wp-team-status-badge.wp-team-status-has-overdue {
  background: #fee2e2; color: #dc2626;
}
.wp-team-status-badge.wp-team-status-all-done {
  background: #d1fae5; color: #059669;
}
.wp-team-status-badge.wp-team-status-in-progress {
  background: #ede9fe; color: #7c3aed;
}

/* 目标与交付行 */
.wp-team-goals-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  background: var(--ui-bg, #f8fafc);
  border-radius: 8px;
  border: 1px solid var(--ui-border, #e2e8f0);
}
.wp-team-goal-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.wp-team-goal-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--tblr-primary, #4361ee);
  white-space: nowrap;
}
.wp-team-goal-val {
  font-size: 0.78rem;
  color: var(--ui-text, #1e293b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.wp-team-no-goal {
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  padding: 6px;
}

/* 进度条 */
.wp-team-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wp-team-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--ui-border, #e2e8f0);
  border-radius: 99px;
  overflow: hidden;
}
.wp-team-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}
.wp-team-progress-label {
  font-size: 0.72rem;
  color: var(--ui-text-muted, #64748b);
  white-space: nowrap;
}

/* 任务 pills */
.wp-team-task-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.wp-team-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wp-team-kind-tag {
  flex: 0 0 auto;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 0.62rem;
  line-height: 1.35;
  font-weight: 700;
  text-decoration: none;
}
.wp-team-kind-plan {
  background: rgba(67, 97, 238, 0.12);
  color: #3651d4;
}
.wp-team-kind-calendar {
  background: rgba(8, 145, 178, 0.12);
  color: #0e7490;
}
.wp-team-pill-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wp-team-pill-open {
  background: #eff6ff; color: #1d4ed8;
}
.wp-team-pill-done {
  background: #f0fdf4; color: #15803d;
  opacity: 0.8;
}
.wp-team-pill-done .wp-team-pill-title {
  text-decoration: line-through;
}
.wp-team-pill-overdue {
  background: #fef2f2; color: #b91c1c;
}
.wp-team-pill-rolled {
  background: #fdf4ff; color: #7e22ce;
}
.wp-team-no-tasks {
  font-size: 0.73rem;
  color: var(--ui-text-muted, #94a3b8);
}

@media (max-width: 768px) {
  .wp-team-header { flex-direction: column; align-items: flex-start; }
  .wp-team-header-stats { gap: 16px; }
  .wp-team-grid { grid-template-columns: 1fr; }
  .wp-goal-lock-banner { flex-direction: column; align-items: flex-start; }
  .wp-goal-set-cta { width: 100%; justify-content: center; }
}

/* ── 周目标与复盘独立弹窗 (高颜值全屏居中 Dialog) ────────── */
dialog.wp-summary-dialog {
  /* inset:auto must come before top/left so top/left 50% wins the cascade */
  inset: auto !important;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  width: min(740px, calc(100vw - 28px));
  max-height: min(92vh, 850px);
  overflow-y: auto;
  box-sizing: border-box;
  border: 1px solid var(--ui-border, #e2e8f0);
  border-radius: 16px;
  padding: 22px 26px;
  background: var(--ui-surface, #ffffff);
  color: var(--ui-text, #1e293b);
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.22);
  z-index: 1050;
}

dialog.wp-summary-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.wp-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.wp-dialog-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wp-dialog-desc {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--ui-text-muted, #64748b);
}

.wp-summary-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 640px) {
  .wp-summary-fields-grid {
    grid-template-columns: 1fr;
  }
}

.wp-field-item label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ui-text, #1e293b);
  margin-bottom: 6px;
}

.wp-field-item textarea {
  width: 100%;
  border: 1px solid var(--ui-border, #cbd5e1);
  border-radius: 8px;
  padding: 10px;
  background: var(--ui-surface-soft, #f8fafc);
  color: var(--ui-text, #1e293b);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.5;
  resize: vertical;
  transition: all 0.15s ease;
}

.wp-field-item textarea:focus {
  background: #ffffff;
  border-color: var(--ui-primary, #4361ee);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}

.wp-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── 标签与事项微徽章 ────────── */
.wp-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.wp-card-tag {
  font-size: 0.64rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.3;
}

.wp-tag-plan {
  background: rgba(67, 97, 238, 0.08);
  color: var(--ui-primary, #4361ee);
}

.wp-tag-memo {
  background: rgba(100, 116, 139, 0.08);
  color: var(--ui-text-muted, #64748b);
}

.wp-tag-rollover {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.wp-tag-from-rollover {
  background: rgba(147, 51, 234, 0.09);
  color: #9333ea;
}

.wp-day-task-card.rolled-over {
  opacity: 0.72;
}

.wp-day-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ui-text-muted, #94a3b8);
  font-size: 0.76rem;
  padding: 36px 8px;
  opacity: 0.8;
}

.wp-day-empty i {
  font-size: 1.2rem;
  opacity: 0.5;
}

/* ── 周报预览 Dialog (全屏居中 Dialog) ────────── */
dialog.wp-report-dialog {
  /* inset:auto must come before top/left so top/left 50% wins the cascade */
  inset: auto !important;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  width: min(760px, calc(100vw - 28px));
  max-height: min(92vh, 850px);
  overflow-y: auto;
  box-sizing: border-box;
  border: 1px solid var(--ui-border, #e2e8f0);
  border-radius: 16px;
  padding: 22px 26px;
  background: var(--ui-surface, #ffffff);
  color: var(--ui-text, #1e293b);
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.22);
  z-index: 1050;
}

dialog.wp-report-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.wp-report-head, .wp-report-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wp-report-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.wp-report-dialog p {
  color: var(--ui-text-muted, #64748b);
  font-size: 0.78rem;
  margin: 8px 0 12px;
}

.wp-report-dialog textarea {
  width: 100%;
  border: 1px solid var(--ui-border, #cbd5e1);
  border-radius: 8px;
  padding: 12px;
  background: var(--ui-surface-soft, #f8fafc);
  color: var(--ui-text, #1e293b);
  font-family: inherit;
  font-size: 0.84rem;
  line-height: 1.6;
  min-height: min(52vh, 480px);
  resize: vertical;
}

.wp-report-dialog textarea:focus {
  background: #ffffff;
  border-color: var(--ui-primary, #4361ee);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}

.wp-report-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

/* ── 移动端 Tab 与响应式 ────────── */
.wp-mobile-days {
  display: none;
}

@media (max-width: 768px) {
  .wp-mobile-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 10px;
  }
  .wp-mobile-days button {
    padding: 6px 2px;
    border: 1px solid var(--ui-border, #e2e8f0);
    border-radius: 8px;
    background: var(--ui-surface, #ffffff);
    color: var(--ui-text, #1e293b);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.12s ease;
  }
  .wp-mobile-days button.active {
    border-color: var(--ui-primary, #4361ee);
    color: var(--ui-primary, #4361ee);
    background: rgba(67, 97, 238, 0.06);
    font-weight: 700;
  }
  .wp-mobile-days small {
    display: block;
    font-size: 0.6rem;
    color: var(--ui-text-muted, #64748b);
  }
  .wp-columns-grid {
    display: block;
    overflow: visible;
    padding: 0;
  }
  .wp-columns-grid .wp-day-column {
    display: none;
  }
  .wp-columns-grid .wp-day-column.is-mobile-selected {
    display: flex;
    min-height: 380px;
  }
}

/* ── 深色模式适配 ────────── */
html[data-theme='dark'] .wp-milestone-bar {
  background: var(--ui-surface, #1e293b);
  border-color: var(--ui-border, #334155);
}
html[data-theme='dark'] .wp-milestone-bar.is-empty {
  background: var(--ui-surface-soft, #0f172a);
  border-color: var(--ui-border, #334155);
}
html[data-theme='dark'] .wp-milestone-btn {
  background: var(--ui-surface-soft, #0f172a);
  border-color: var(--ui-border, #334155);
  color: var(--ui-text-muted, #94a3b8);
}
html[data-theme='dark'] .wp-summary-dialog,
html[data-theme='dark'] .wp-report-dialog {
  background: var(--ui-surface, #1e293b);
  border-color: var(--ui-border, #334155);
  color: var(--ui-text, #f8fafc);
}
html[data-theme='dark'] .wp-field-item textarea,
html[data-theme='dark'] .wp-report-dialog textarea {
  background: var(--ui-surface-soft, #0f172a);
  border-color: var(--ui-border, #334155);
  color: var(--ui-text, #f8fafc);
}
html[data-theme='dark'] .wp-field-item label,
html[data-theme='dark'] .wp-pill-text {
  color: var(--ui-text, #f8fafc);
}
html[data-theme='dark'] .wp-mobile-days button {
  background: var(--ui-surface, #1e293b);
  border-color: var(--ui-border, #334155);
  color: var(--ui-text, #f8fafc);
}

/* ================= 全新现代化侧边栏与工作台布局 (Modern Sidebar & Header Layout) ================= */
:root {
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 68px;
  --header-height: 56px;
  --bg-canvas: #f8fafc;
  --sidebar-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
}

html[data-theme='dark'],
:root[data-theme='dark'],
body[data-theme='dark'] {
  --bg-canvas: #0f172a;
  --sidebar-bg: #1e293b;
  --border-color: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

body {
  background-color: var(--bg-canvas) !important;
  color: var(--text-main) !important;
  overflow-x: hidden !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 主架构容器 (App Shell) */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  background-color: var(--bg-canvas);
}

/* ================= 左侧侧边栏 (Sidebar) ================= */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.42s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
  will-change: width;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  user-select: none;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-main);
  transition: opacity 0.2s ease;
}

.logo-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border-radius: 999px;
  font-weight: 600;
  margin-left: 4px;
}
html[data-theme='dark'] .logo-badge {
  background: rgba(96, 165, 250, 0.2);
  color: #60a5fa;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-group-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 10px 10px 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item,
.app-sidebar .nav-item,
.app-sidebar button.nav-item,
.app-sidebar .nav-item.toolbar-btn,
.app-sidebar .nav-item.toolbar-btn-secondary,
.app-sidebar .nav-item.toolbar-btn-primary,
.app-sidebar .nav-item.btn,
.app-sidebar .nav-item.btn-outline-secondary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--text-muted) !important;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.18s ease;
  white-space: nowrap;
  overflow: hidden;
  border: none !important;
  border-width: 0 !important;
  border-color: transparent !important;
  background: transparent !important;
  width: 100%;
  cursor: pointer;
  text-align: left;
  outline: none !important;
  box-shadow: none !important;
}

.nav-item:hover,
.app-sidebar .nav-item:hover,
.app-sidebar button.nav-item:hover,
.app-sidebar .nav-item.toolbar-btn:hover,
.app-sidebar .nav-item.btn-outline-secondary:hover {
  background-color: var(--ui-surface-hover, #f1f5f9) !important;
  color: var(--text-main) !important;
  border: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
html[data-theme='dark'] .nav-item:hover,
html[data-theme='dark'] .app-sidebar .nav-item:hover {
  background-color: #334155 !important;
  color: #f8fafc !important;
  border: none !important;
}

.nav-item.active,
.app-sidebar .nav-item.active,
.app-sidebar button.nav-item.active {
  background-color: rgba(37, 99, 235, 0.1) !important;
  color: #2563eb !important;
  font-weight: 600 !important;
  border: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
html[data-theme='dark'] .nav-item.active,
html[data-theme='dark'] .app-sidebar .nav-item.active {
  background-color: rgba(37, 99, 235, 0.25) !important;
  color: #60a5fa !important;
  border: none !important;
}

/* 平滑无感深浅主题切换过渡 (避免突兀闪屏) */
html, body, .app-layout, .app-sidebar, .app-header, .app-main, .month-calendar, .team-leaderboard, .card {
  transition: background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), color 0.18s ease !important;
}

/* 侧栏宽度动画不能被上面的主题切换 transition 覆盖，否则折叠/展开会瞬间跳变。 */
.app-sidebar {
  transition: width 0.42s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.18s ease !important;
}

/* 保证鼠标悬停在日历格子上都能自然顺畅上下滚动整个网页 */
.day-memos,
.calendar-day,
.calendar-grid,
.month-calendar {
  overscroll-behavior: auto !important;
}

.nav-item i {
  font-size: 1.05rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.18s ease;
}

.nav-item:hover i {
  color: var(--text-main);
}

.nav-item.active i {
  color: #2563eb;
}
html[data-theme='dark'] .nav-item.active i {
  color: #60a5fa;
}

.nav-item .nav-label {
  flex: 1;
  transition: opacity 0.2s ease;
}

.nav-item .nav-pill {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ef4444;
  color: white;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
}

.sidebar-divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 6px;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border-color);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--ui-surface-soft, #f8fafc);
  border: 1px solid var(--border-color);
  overflow: hidden;
}
html[data-theme='dark'] .user-card {
  background: #0f172a;
  border-color: #334155;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0369a1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
html[data-theme='dark'] .user-avatar {
  background: #1e3a8a;
  color: #93c5fd;
}

.user-info {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout-btn {
  background: transparent !important;
  border: none !important;
  color: var(--text-muted) !important;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  box-shadow: none !important;
}
.sidebar-logout-btn:hover {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.1) !important;
}

/* ================= 折叠状态 (Collapsed State) ================= */
/* 可折叠文本元素的平滑淡入淡出、位移与宽度收缩过渡 */
.app-sidebar .logo-text,
.app-sidebar .logo-badge,
.app-sidebar .nav-label,
.app-sidebar .nav-group-title,
.app-sidebar .user-info,
.app-sidebar .nav-pill,
.app-sidebar .sidebar-logout-btn {
  opacity: 1;
  transform: translateX(0);
  max-width: 180px;
  visibility: visible;
  transition: opacity 0.22s ease 0.14s,
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
              max-width 0.42s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s linear 0s;
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}

.app-sidebar .sidebar-header,
.app-sidebar .nav-item,
.app-sidebar .user-card {
  transition: padding 0.42s cubic-bezier(0.4, 0, 0.2, 1),
              margin 0.42s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.42s cubic-bezier(0.4, 0, 0.2, 1),
              gap 0.28s ease,
              background-color 0.2s ease,
              color 0.18s ease;
}

.app-sidebar.collapsed {
  width: var(--sidebar-collapsed-width) !important;
}

/* 隐藏在折叠状态下不需要的多余文本元素，防止占位产生 flex gap 偏移 */
.app-sidebar.collapsed .logo-text,
.app-sidebar.collapsed .logo-badge,
.app-sidebar.collapsed .nav-label,
.app-sidebar.collapsed .user-info,
.app-sidebar.collapsed .sidebar-logout-btn {
  opacity: 0 !important;
  transform: translateX(-8px) !important;
  max-width: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.15s ease 0s,
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0s,
              max-width 0.32s cubic-bezier(0.4, 0, 0.2, 1) 0s,
              visibility 0s linear 0.18s !important;
}

/* 分组标题折叠后不保留垂直占位。 */
.app-sidebar.collapsed .nav-group-title {
  display: none !important;
}

.app-sidebar.collapsed .sidebar-logout-btn {
  width: 0 !important;
  min-width: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 顶部 Logo 完美居中 */
.app-sidebar.collapsed .sidebar-header {
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: var(--header-height) !important;
}

.app-sidebar.collapsed .sidebar-logo {
  gap: 0 !important;
  padding: 0 !important;
  margin: 0 auto !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
}

.app-sidebar.collapsed .logo-icon {
  width: 38px !important;
  height: 38px !important;
  margin: 0 auto !important;
  border-radius: 11px !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22) !important;
}

/* 导航容器内边距收敛，垂直轴统一对齐 */
.app-sidebar.collapsed .sidebar-nav {
  padding: 14px 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
}

/* 分隔线居中细线 */
.app-sidebar.collapsed .sidebar-divider {
  width: 32px !important;
  height: 1px !important;
  margin: 8px auto !important;
  background: var(--border-color) !important;
  opacity: 0.7 !important;
}

/* 核心导航项：统一规格的 42x42 方圆精致磁贴 (Icon Tile) */
.app-sidebar.collapsed .nav-item:not([hidden]) {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  padding: 0 !important;
  margin: 2px auto !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 0 !important;
  border-radius: 11px !important;
  position: relative !important;
  box-sizing: border-box !important;
  transition: all 0.32s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.app-sidebar.collapsed .nav-item[hidden],
.app-sidebar.collapsed .nav-item[style*="display: none"],
.app-sidebar.collapsed .nav-item[style*="display:none"] {
  display: none !important;
}

.app-sidebar.collapsed .nav-item i {
  width: 42px !important;
  height: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.12rem !important;
  line-height: 1 !important;
  text-align: center !important;
  color: var(--text-muted) !important;
  transition: all 0.32s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.app-sidebar.collapsed .nav-item:hover {
  background-color: var(--ui-surface-hover, #f1f5f9) !important;
  transform: scale(1.06);
}

.app-sidebar.collapsed .nav-item:hover i {
  color: var(--text-main) !important;
}

html[data-theme='dark'] .app-sidebar.collapsed .nav-item:hover {
  background-color: #334155 !important;
}

/* 激活状态的高亮底色与微投影 */
.app-sidebar.collapsed .nav-item.active {
  background-color: rgba(37, 99, 235, 0.12) !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15) !important;
  transform: scale(1.02);
}

.app-sidebar.collapsed .nav-item.active i {
  color: #2563eb !important;
}

html[data-theme='dark'] .app-sidebar.collapsed .nav-item.active {
  background-color: rgba(37, 99, 235, 0.28) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme='dark'] .app-sidebar.collapsed .nav-item.active i {
  color: #60a5fa !important;
}

/* 折叠状态下的右上角小红点角标 */
.app-sidebar.collapsed .nav-item .nav-pill {
  display: block !important;
  position: absolute !important;
  top: 5px !important;
  right: 5px !important;
  min-width: 8px !important;
  width: 8px !important;
  height: 8px !important;
  padding: 0 !important;
  font-size: 0 !important;
  border-radius: 50% !important;
  background: #ef4444 !important;
  border: 2px solid var(--sidebar-bg) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
  opacity: 1 !important;
  pointer-events: none !important;
}

.app-sidebar.collapsed .nav-item .nav-pill[style*="display: none"] {
  display: none !important;
}

/* 底部个人信息卡片：去除粗笨的外框，化为居中的优雅圆形头像 */
.app-sidebar.collapsed .sidebar-footer {
  padding: 12px 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.app-sidebar.collapsed .user-card {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 auto !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  gap: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  transition: all 0.32s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.app-sidebar.collapsed .user-card:hover {
  background: transparent !important;
  transform: scale(1.08);
}

.app-sidebar.collapsed .user-avatar {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  border-radius: 50% !important;
  margin: 0 auto !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
  border: 2px solid rgba(255, 255, 255, 0.8) !important;
}

html[data-theme='dark'] .app-sidebar.collapsed .user-avatar {
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* ================= 右侧主工作台 (App Main) ================= */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
}

/* 顶部通栏导航 (App Header) */
.app-header {
  height: var(--header-height);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-toggle-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-color);
  background: var(--sidebar-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-toggle-btn:hover {
  background: var(--ui-surface-hover, #f1f5f9);
  color: var(--ui-accent, #3b82f6);
  border-color: var(--ui-accent, #3b82f6);
  transform: scale(1.05);
}

.sidebar-toggle-btn:active {
  transform: scale(0.95);
}

.sidebar-toggle-svg {
  width: 18px;
  height: 18px;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.2s ease;
  flex-shrink: 0;
}

.sidebar-toggle-btn .icon-expand {
  display: none;
}

.sidebar-toggle-btn.is-collapsed .icon-collapse {
  display: none;
}

.sidebar-toggle-btn.is-collapsed .icon-expand {
  display: block;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-search {
  position: relative;
  width: 240px;
}

.header-search input {
  width: 100%;
  height: 34px;
  padding: 0 28px 0 34px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  outline: none;
  background: var(--ui-surface-soft, #f8fafc);
  color: var(--text-main);
  transition: all 0.2s ease;
}

.header-search input:focus {
  background: var(--sidebar-bg);
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.header-search > i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.header-search .clear-search {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.8rem;
  display: none;
}
.header-search .clear-search.visible {
  display: block;
}

.topbar-member-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.member-select,
.header-month-select {
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  background: var(--sidebar-bg);
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.month-count-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-new-memo {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  background: #2563eb;
  color: white;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-new-memo:hover {
  background: #1d4ed8;
}

/* 主体内容区 (App Body) */
.app-body {
  padding: 8px 18px 12px !important;
  display: flex;
  flex-direction: column;
  gap: 10px !important;
  width: 100%;
  min-width: 0;
  flex: 1;
}

/* 团队排行榜卡片与日历卡片 */
.team-leaderboard,
.calendar-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}
.team-leaderboard {
  padding: 13px 16px !important;
}
.leaderboard-header {
  margin-bottom: 10px !important;
}

/* 隐藏旧版多余浮动按钮，因侧栏已整合 */
.floating-actions {
  display: none !important;
}

/* 侧边栏深色模式适配 */
html[data-theme='dark'] .sidebar-toggle-btn {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}
html[data-theme='dark'] .sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #38bdf8;
  border-color: #38bdf8;
}
html[data-theme='dark'] .header-search input {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}
html[data-theme='dark'] .member-select,
html[data-theme='dark'] .header-month-select {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

/* 侧栏半透明遮罩背景 (抽屉打开时) */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-close-btn {
  display: none;
}

/* 移动端响应式适配 (<= 768px) */
@media (max-width: 768px) {
  .app-layout {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .app-main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* 抽屉式侧边栏 */
  .app-sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: min(280px, 80vw) !important;
    height: 100% !important;
    height: 100dvh !important;
    z-index: 1000 !important;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.35) !important;
    transform: translateX(-100%) !important;
    transition: transform 0.36s cubic-bezier(0.16, 1, 0.3, 1) !important;
    background: var(--sidebar-bg) !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .app-sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  .sidebar-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .sidebar-close-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    background: var(--sidebar-bg) !important;
    color: var(--text-muted) !important;
    cursor: pointer !important;
    font-size: 0.9rem !important;
    transition: all 0.15s ease !important;
  }
  .sidebar-close-btn:hover {
    color: var(--text-main) !important;
    background: var(--ui-surface-hover, #f1f5f9) !important;
  }

  /* 遮罩激活状态与平滑过渡 */
  .sidebar-backdrop {
    display: block !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.36s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  .sidebar-backdrop.active {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* 手机端标题与筛选分两行，避免选择器挤占页面名称 */
  .app-header {
    height: auto !important;
    min-height: 50px !important;
    padding: 0 12px 8px !important;
    margin-bottom: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 120 !important;
    background: var(--sidebar-bg) !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  .header-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 50px !important;
    min-width: 0 !important;
  }

  .sidebar-toggle-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    border-radius: 6px !important;
  }

  .header-breadcrumb {
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: calc(100vw - 80px) !important;
    letter-spacing: -0.2px;
  }

  .header-breadcrumb i {
    font-size: 0.95rem !important;
  }

  .header-right {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    padding-top: 8px !important;
    border-top: 1px solid var(--border-color) !important;
    flex-wrap: nowrap !important;
  }

  /* 隐藏桌面专属大搜索框与多余的新建按钮 */
  .header-search {
    display: none !important;
  }
  .btn-new-memo {
    display: none !important;
  }

  /* 两个筛选器共用一套轻量控件，去掉旧月份选择器的双重外框 */
  .topbar-member-selector {
    display: flex !important;
    align-items: center !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  .topbar-member-selector label {
    display: none !important;
  }
  .topbar-member-selector .member-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  .month-count-selector {
    display: flex !important;
    align-items: center !important;
    flex: 0 0 106px !important;
    width: 106px !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  .month-count-selector label {
    display: none !important;
  }
  .topbar-member-selector .member-select,
  .month-count-selector .header-month-select {
    height: 36px !important;
    width: 100% !important;
    padding: 0 10px !important;
    border-radius: 9px !important;
    background: var(--ui-surface-soft) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .topbar-member-selector .member-select:focus-visible,
  .month-count-selector .header-month-select:focus-visible {
    border-color: var(--ui-accent) !important;
    box-shadow: 0 0 0 3px var(--ui-focus-ring) !important;
  }
  .app-header .topbar-member-selector[hidden],
  .app-header .month-count-selector[hidden] {
    display: none !important;
  }
  .app-header:has(.topbar-member-selector[hidden] + .month-count-selector[hidden]) {
    padding-bottom: 0 !important;
  }
  .app-header:has(.topbar-member-selector[hidden] + .month-count-selector[hidden]) .header-right {
    display: none !important;
  }

  /* 仅显示月份选择器时（普通员工视图），左右两端对齐展示“显示月数”标签与下拉框，视觉更饱满对称 */
  .app-header:has(.topbar-member-selector[hidden]) .month-count-selector:not([hidden]) {
    flex: 1 1 auto !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .app-header:has(.topbar-member-selector[hidden]) .month-count-selector:not([hidden]) label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
  }
  .app-header:has(.topbar-member-selector[hidden]) .month-count-selector:not([hidden]) .header-month-select,
  .app-header:has(.topbar-member-selector[hidden]) .month-count-selector:not([hidden]) .custom-dropdown,
  .app-header:has(.topbar-member-selector[hidden]) .month-count-selector:not([hidden]) .custom-dropdown-btn {
    flex: 0 0 116px !important;
    width: 116px !important;
  }

  /* 主体工作区适配 */
  .app-body {
    padding: 12px 10px !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 周计划首卡片与其他页面保持一致的顶部间距。 */
  .app-main:has(.weekly-plan-page:not([hidden])) > .app-body {
    padding-top: 8px !important;
  }
  .app-main .weekly-plan-page:not([hidden]) {
    padding-top: 4px;
  }

  /* 日历及当天事项共用整页纵向滚动，避免内部空滚动层吞掉手势。 */
  html, body, .app-layout, .calendar-container,
  .multi-month-calendar, .month-calendar {
    overflow-x: clip !important;
  }
  .app-layout, .calendar-container,
  .multi-month-calendar, .month-calendar {
    overflow-y: visible !important;
  }
  .calendar-day, .calendar-day .day-memos {
    overflow: clip !important;
  }
}

/* ========================================================
   全端高精度 UI/UX 打磨优化（桌面端与移动端）
   ======================================================== */

/* 1. 吸顶导航场景滚动防护：防止切换视图或锚点定位时顶部内容被吸顶栏遮挡 */
.dashboard-page,
.weekly-plan-page,
.multi-month-calendar,
.calendar-container,
#dashboardPage,
#weeklyPlanPage,
#multiMonthCalendar {
  scroll-margin-top: 76px !important;
}

/* 2. 备忘录颜色色盘：工整对称 5×2 网格布局，消除单项尴尬换行 */
.color-options {
  display: grid !important;
  grid-template-columns: repeat(5, 30px) !important;
  gap: 10px 12px !important;
  align-items: center !important;
  min-height: 44px !important;
  padding: 4px 0 !important;
}
.color-option {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  border: 2px solid transparent !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12) !important;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s ease !important;
}
.color-option:hover {
  transform: scale(1.18) !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
}
.color-option.selected,
.color-option.active {
  border-color: #ffffff !important;
  box-shadow: 0 0 0 2.5px var(--ui-accent, #2563eb), 0 3px 8px rgba(0, 0, 0, 0.25) !important;
  transform: scale(1.12) !important;
}

/* 4. 月历卡片：一键完成按钮空态与已全满状态 */
.complete-all-btn.all-completed {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  cursor: default !important;
  pointer-events: none !important;
  box-shadow: none !important;
  transform: none !important;
  opacity: 0.9 !important;
}
.complete-all-btn.empty-disabled {
  background: var(--ui-surface-soft, rgba(0, 0, 0, 0.04)) !important;
  color: var(--ui-text-muted, #94a3b8) !important;
  border: 1px solid var(--ui-border, #e2e8f0) !important;
  cursor: default !important;
  pointer-events: none !important;
  box-shadow: none !important;
  transform: none !important;
  opacity: 0.65 !important;
}
html[data-theme='dark'] .complete-all-btn.all-completed {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
}
html[data-theme='dark'] .complete-all-btn.empty-disabled {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #64748b !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* 5. 移动端专属微调：提醒中心分类标签与弹窗底栏 */
@media (max-width: 600px) {
  .reminder-filter-tabs {
    gap: 5px !important;
    padding-bottom: 4px !important;
    justify-content: space-between !important;
  }
  .reminder-tab {
    padding: 5px 8px !important;
    font-size: 0.78rem !important;
    flex: 1 1 auto !important;
    text-align: center !important;
    justify-content: center !important;
    gap: 4px !important;
    min-width: 0 !important;
  }
  .reminder-tab .tab-count {
    padding: 1px 5px !important;
    font-size: 0.7rem !important;
  }
  .color-options {
    grid-template-columns: repeat(5, 32px) !important;
    gap: 8px 14px !important;
    justify-content: flex-start !important;
  }
}

/* 6. 桌面端日期单元格悬停微交互 */
@media (min-width: 769px) {
  .calendar-day:not(.other-month):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    border-color: var(--ui-accent, #3b82f6) !important;
    z-index: 2;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  }
}

/* 7. 模态弹窗毛玻璃质感背景 */
.modal,
.reminder-modal {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
dialog::backdrop {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: rgba(0, 0, 0, 0.45);
}

/* ========================================================
   现代定制化下拉选择器 (Custom Modern SaaS Dropdown)
   ======================================================== */
.custom-dropdown {
  position: relative;
  display: inline-block;
  user-select: none;
}

.custom-dropdown-btn {
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--ui-surface-soft, #f1f5f9);
  color: var(--ui-text, #1e293b);
  border: 1px solid var(--ui-border, #e2e8f0);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.custom-dropdown-btn:hover {
  background: var(--ui-surface-hover, #e2e8f0);
  border-color: var(--ui-accent, #3b82f6);
}

.custom-dropdown-btn.active {
  border-color: var(--ui-accent, #3b82f6);
  background: var(--ui-surface, #ffffff);
  box-shadow: 0 0 0 3px var(--ui-focus-ring, rgba(59, 130, 246, 0.2));
}

.custom-dropdown-btn .custom-dropdown-icon {
  color: var(--ui-accent, #3b82f6);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
}

.custom-dropdown-btn .custom-dropdown-text {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-dropdown-btn .custom-dropdown-caret {
  font-size: 0.72rem;
  color: var(--ui-text-muted, #94a3b8);
  transition: transform 0.2s ease;
  margin-left: 2px;
}

.custom-dropdown-btn.active .custom-dropdown-caret {
  transform: rotate(180deg);
  color: var(--ui-accent, #3b82f6);
}

/* 浮动下拉菜单面板 */
.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  max-width: 280px;
  max-height: 340px;
  background: var(--ui-surface, #ffffff) !important;
  border: 1px solid var(--ui-border, #e2e8f0) !important;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.06);
  padding: 6px;
  z-index: 1050;
  overflow-y: auto;
  animation: dropdownFadeIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.custom-dropdown-menu[hidden] {
  display: none !important;
}

.custom-dropdown-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* 下拉菜单单项 */
.custom-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--ui-text, #1e293b);
  transition: all 0.15s ease;
}

.custom-dropdown-item:hover {
  background: var(--ui-surface-hover, #f1f5f9);
  color: var(--ui-accent, #2563eb);
}

.custom-dropdown-item.selected {
  background: rgba(37, 99, 235, 0.08) !important;
  color: var(--ui-accent, #2563eb) !important;
  font-weight: 600;
}

.custom-dropdown-item .item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.custom-dropdown-item .item-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.12);
  color: var(--ui-accent, #2563eb);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.custom-dropdown-item .item-avatar.all {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.custom-dropdown-item .item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-dropdown-item .item-badge {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ui-text-muted, #64748b);
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.custom-dropdown-item .item-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: #0284c7;
  background: rgba(2, 132, 199, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
}

.custom-dropdown-item .item-tag.default {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.custom-dropdown-item .item-check {
  font-size: 0.75rem;
  color: var(--ui-accent, #2563eb);
  flex-shrink: 0;
  margin-left: 6px;
}

.custom-dropdown-item .item-icon {
  font-size: 0.85rem;
  color: var(--ui-accent, #2563eb);
}

/* 暗色主题适配 */
html[data-theme='dark'] .custom-dropdown-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

html[data-theme='dark'] .custom-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: #38bdf8;
}

html[data-theme='dark'] .custom-dropdown-btn.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

html[data-theme='dark'] .custom-dropdown-menu {
  background: #0f172a !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme='dark'] .custom-dropdown-item {
  color: #e2e8f0;
}

html[data-theme='dark'] .custom-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #38bdf8;
}

html[data-theme='dark'] .custom-dropdown-item.selected {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
}

html[data-theme='dark'] .custom-dropdown-item .item-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

/* 移动端顶栏定制下拉按钮宽度 */
@media (max-width: 768px) {
  .topbar-member-selector .custom-dropdown,
  .topbar-member-selector .custom-dropdown-btn {
    width: 100% !important;
    display: flex !important;
  }
  .month-count-selector .custom-dropdown,
  .month-count-selector .custom-dropdown-btn {
    width: 100% !important;
    display: flex !important;
  }
  .custom-dropdown-btn .custom-dropdown-text {
    max-width: none !important;
    flex: 1 !important;
    text-align: left !important;
  }
  #customMemberSelect .custom-dropdown-menu {
    left: 0 !important;
    right: auto !important;
    min-width: 240px !important;
    max-width: min(280px, calc(100vw - 24px)) !important;
  }
  #customMonthSelect .custom-dropdown-menu {
    right: 0 !important;
    left: auto !important;
    min-width: 160px !important;
    max-width: min(200px, calc(100vw - 24px)) !important;
  }
}

/* ==========================================================================
   全方位现代化 UI/UX 升级 (Phase 1, Phase 2, Phase 3 一体化实施)
   ========================================================================== */

/* 1. 全局弹窗暗色模式彻底修复与分层质感 (Phase 1) */
html[data-theme='dark'] .modal-content,
html[data-theme='dark'] :is(#functionsModal, #memoModal, #dailyDetailModal, #reminderModal, #settingsModal, #teamModal) .modal-content,
html[data-theme='dark'] :is(#functionsModal, #memoModal, #dailyDetailModal, #reminderModal, #settingsModal, #teamModal) .modal-header,
html[data-theme='dark'] :is(#functionsModal, #memoModal, #dailyDetailModal, #reminderModal, #settingsModal, #teamModal) .modal-body,
html[data-theme='dark'] :is(#functionsModal, #memoModal, #dailyDetailModal, #reminderModal, #settingsModal, #teamModal) .modal-footer {
  background-color: #111827 !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme='dark'] :is(#functionsModal, #memoModal, #dailyDetailModal, #reminderModal) .modal-content {
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

html[data-theme='dark'] #functionsModal .tabs {
  background: #090d16 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html[data-theme='dark'] #functionsModal .tab {
  color: #94a3b8 !important;
}

html[data-theme='dark'] #functionsModal .tab:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
}

html[data-theme='dark'] #functionsModal .tab.active {
  background: #1e293b !important;
  color: #38bdf8 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme='dark'] #functionsModal :is(.task-publish-info, .export-info, .data-stats-card, .excel-export-panel) {
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
}

html[data-theme='dark'] #functionsModal .form-group label {
  color: #cbd5e1 !important;
}

html[data-theme='dark'] #functionsModal .form-control {
  background: #0b1120 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #f8fafc !important;
}

/* 暗色模式下所有取消与关闭次级按钮 (幽灵按钮规范) */
html[data-theme='dark'] :is(.btn-secondary, #memoModalCancel, #closeFunctionsModalBtn, #closeDailyDetailModalBtn, #memoFormCancel) {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

html[data-theme='dark'] :is(.btn-secondary, #memoModalCancel, #closeFunctionsModalBtn, #closeDailyDetailModalBtn, #memoFormCancel):hover {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

/* 暗色模式下备忘录模态复选框与文字反色修复 */
html[data-theme='dark'] .memo-weekly-plan-toggle {
  color: #cbd5e1 !important;
}

html[data-theme='dark'] .memo-title-completed {
  background: #0f172a !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

html[data-theme='dark'] .memo-title-completed:hover {
  background: rgba(59, 130, 246, 0.15) !important;
  border-color: #3b82f6 !important;
  color: #60a5fa !important;
}

html[data-theme='dark'] .memo-title-completed.is-completed {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: #10b981 !important;
  color: #34d399 !important;
}

/* 2. 全局数字开启等宽对齐排版 (防止数字变化或对齐时左右抖动) (Phase 1) */
.calendar-day .day-number,
.stat-item,
.leaderboard-rate,
.leaderboard-stats,
.leaderboard-rank,
.badge,
.wp-summary-pill,
.header-month-select,
.custom-dropdown-text,
.current-period {
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: 'tnum' 1, 'cv01' 1 !important;
}

/* 3. 移动端浮动操作按钮 (Floating Action Button - FAB +) (Phase 2) */
.mobile-fab {
  display: none;
}
@media (max-width: 768px) {
  .mobile-fab {
    display: flex !important;
    position: fixed !important;
    right: 20px !important;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    width: 52px !important;
    height: 52px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    border: none !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.42), 0 2px 6px rgba(0, 0, 0, 0.2) !important;
    z-index: 995 !important;
    cursor: pointer !important;
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.24s ease, opacity 0.2s ease !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .mobile-fab:hover {
    transform: scale(1.08) translateY(-2px) !important;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.52), 0 3px 8px rgba(0, 0, 0, 0.25) !important;
  }

  .mobile-fab:active {
    transform: scale(0.92) !important;
  }

  /* 移动端周计划星期选择栏人体工学与触控热区升级 */
  .wp-day-pill,
  .wp-mobile-tabs button {
    min-height: 44px !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
}

/* 4. 现代交互微动效体系与弹性反馈 (Phase 3) */
/* 页面视图平滑淡入转场 (Cross-fade View Transition) */
.view-enter-active {
  animation: pageFadeSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  will-change: opacity, transform;
}

@keyframes pageFadeSlideIn {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 任务打勾弹性微成就感动效 */
@keyframes checkmarkBounce {
  0% { transform: scale(1); }
  35% { transform: scale(1.22); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

input[type="checkbox"]:checked {
  animation: checkmarkBounce 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* 按钮微按压弹性反馈 */
.btn:active,
.sidebar-toggle-btn:active,
.nav-item:active {
  transform: scale(0.97) !important;
}

/* 5. 团队排行榜 Top 3 领奖台金属微光与紧凑折叠 (Phase 3) */
.leaderboard-card.rank-1 {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(254, 240, 138, 0.04) 100%), var(--ui-surface) !important;
  border: 1.5px solid rgba(245, 158, 11, 0.45) !important;
  box-shadow: 0 4px 16px -2px rgba(245, 158, 11, 0.18) !important;
}
.leaderboard-card.rank-1 .leaderboard-rank {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.45) !important;
}

.leaderboard-card.rank-2 {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.08) 0%, rgba(226, 232, 240, 0.03) 100%), var(--ui-surface) !important;
  border: 1.5px solid rgba(148, 163, 184, 0.4) !important;
  box-shadow: 0 4px 14px -2px rgba(148, 163, 184, 0.15) !important;
}
.leaderboard-card.rank-2 .leaderboard-rank {
  background: linear-gradient(135deg, #94a3b8, #64748b) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(100, 116, 139, 0.35) !important;
}

.leaderboard-card.rank-3 {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.08) 0%, rgba(251, 191, 36, 0.03) 100%), var(--ui-surface) !important;
  border: 1.5px solid rgba(217, 119, 6, 0.35) !important;
  box-shadow: 0 4px 14px -2px rgba(217, 119, 6, 0.15) !important;
}
.leaderboard-card.rank-3 .leaderboard-rank {
  background: linear-gradient(135deg, #b45309, #78350f) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.35) !important;
}

/* 暗色模式下前三名金属微光微调 */
html[data-theme='dark'] .leaderboard-card.rank-1 {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(30, 41, 59, 0.7) 100%) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  box-shadow: 0 8px 24px -4px rgba(245, 158, 11, 0.25), 0 0 12px rgba(245, 158, 11, 0.15) !important;
}
html[data-theme='dark'] .leaderboard-card.rank-2 {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.1) 0%, rgba(30, 41, 59, 0.7) 100%) !important;
  border-color: rgba(148, 163, 184, 0.4) !important;
}
html[data-theme='dark'] .leaderboard-card.rank-3 {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.1) 0%, rgba(30, 41, 59, 0.7) 100%) !important;
  border-color: rgba(217, 119, 6, 0.4) !important;
}

/* 排行榜折叠/展开操作按钮 */
.leaderboard-toggle-wrap {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}
.leaderboard-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ui-text-muted);
  background: var(--ui-surface-soft);
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.leaderboard-toggle-btn:hover {
  background: var(--ui-surface-hover);
  color: var(--ui-accent);
  border-color: var(--ui-accent);
  transform: translateY(-1px);
}

/* ================= 工作日志增强打磨：模板栏与结转待办 ================= */
.memo-template-chips-bar {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 10px !important;
  background: var(--ui-surface-soft, #f8fafc) !important;
  border: 1px solid var(--ui-border, #e2e8f0) !important;
  border-top: none !important;
  border-radius: 0 0 8px 8px !important;
  margin-bottom: 8px !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}
.memo-template-chips-bar::-webkit-scrollbar {
  display: none !important;
}
.template-chips-label {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  color: var(--ui-text-muted, #64748b) !important;
  white-space: nowrap !important;
}
.btn-template-chip {
  padding: 3px 9px !important;
  border-radius: 6px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  background: var(--ui-surface, #ffffff) !important;
  border: 1px solid var(--ui-border, #cbd5e1) !important;
  color: var(--ui-text-main, #334155) !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}
.btn-template-chip:hover {
  background: rgba(37, 99, 235, 0.08) !important;
  border-color: #3b82f6 !important;
  color: #2563eb !important;
  transform: translateY(-1px) !important;
}
.btn-template-chip.chip-carryover {
  background: rgba(16, 185, 129, 0.08) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #059669 !important;
}
.btn-template-chip.chip-carryover:hover {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: #10b981 !important;
  color: #047857 !important;
}

html[data-theme='dark'] .memo-template-chips-bar {
  background: #111a27 !important;
  border-color: #23354d !important;
}
html[data-theme='dark'] .btn-template-chip {
  background: #182433 !important;
  border-color: #2b3d56 !important;
  color: #cbd5e1 !important;
}
html[data-theme='dark'] .btn-template-chip:hover {
  background: rgba(59, 130, 246, 0.2) !important;
  border-color: #60a5fa !important;
  color: #93c5fd !important;
}
html[data-theme='dark'] .btn-template-chip.chip-carryover {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #34d399 !important;
}

/* ================= 顶栏快捷生成周报按钮 ================= */
.btn-quick-report {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  height: 36px !important;
  padding: 0 12px !important;
  border-radius: 9px !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  border: 1px solid var(--ui-border, #cbd5e1) !important;
  background: var(--ui-surface, #ffffff) !important;
  color: var(--ui-primary, #2563eb) !important;
  transition: all 0.15s ease !important;
  flex-shrink: 0 !important;
}
.btn-quick-report:hover {
  background: rgba(37, 99, 235, 0.08) !important;
  border-color: var(--ui-primary, #2563eb) !important;
  transform: translateY(-1px) !important;
}
html[data-theme='dark'] .btn-quick-report {
  background: #182433 !important;
  border-color: #2b3d56 !important;
  color: #60a5fa !important;
}
html[data-theme='dark'] .btn-quick-report:hover {
  background: rgba(59, 130, 246, 0.18) !important;
  border-color: #3b82f6 !important;
}
@media (max-width: 768px) {
  .btn-quick-report {
    display: none !important;
  }
}

/* ================= 每日事项卡片点赞与已阅图章 ================= */
.task-stamp {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  padding: 1px 6px !important;
  border-radius: 4px !important;
  margin-left: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  vertical-align: middle !important;
}
.task-stamp.read {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}
.task-stamp.like {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}
.task-btn.task-btn-react {
  color: var(--ui-text-muted, #64748b) !important;
}
.task-btn.task-btn-react:hover {
  color: #2563eb !important;
  background: rgba(37, 99, 235, 0.08) !important;
}
.task-btn.task-btn-react.active {
  color: #10b981 !important;
  background: rgba(16, 185, 129, 0.12) !important;
  font-weight: 700 !important;
}

/* ================= 备忘录编辑弹窗重新排版与充裕高度 ================= */
#memoModal .modal-content {
  width: min(860px, 94vw) !important;
  max-width: 860px !important;
  max-height: 92vh !important;
}

.memo-title-row-compact {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
}
.memo-title-field {
  flex: 1 1 auto !important;
}
.memo-title-input {
  height: 42px !important;
  font-size: 1.02rem !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  padding: 0 12px !important;
}
.memo-switches-group {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}
.memo-toggle-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  height: 38px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  border: 1px solid var(--ui-border, #cbd5e1) !important;
  background: var(--ui-surface-soft, #f8fafc) !important;
  color: var(--ui-text-muted, #64748b) !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: all 0.15s ease !important;
  margin: 0 !important;
}
.memo-toggle-chip:hover {
  background: rgba(37, 99, 235, 0.08) !important;
  border-color: #3b82f6 !important;
  color: var(--ui-primary, #2563eb) !important;
}
.memo-toggle-chip:has(input:checked) {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: #10b981 !important;
  color: #059669 !important;
}
.memo-toggle-chip input[type="checkbox"] {
  accent-color: #10b981 !important;
  cursor: pointer !important;
}

/* 元数据三列网格 */
.memo-meta-grid {
  display: grid !important;
  grid-template-columns: 1fr 1.35fr 1fr !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
  padding: 10px 12px !important;
  background: var(--ui-surface-soft, #f8fafc) !important;
  border: 1px solid var(--ui-border, #e2e8f0) !important;
  border-radius: 10px !important;
}
.memo-meta-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}
.memo-meta-col label {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  color: var(--ui-text-muted, #64748b) !important;
  margin-bottom: 2px !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
}
.memo-meta-col .custom-date-input {
  height: 36px !important;
  font-size: 0.88rem !important;
  border-radius: 6px !important;
}
.quick-due-chips.compact {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  margin-top: 4px !important;
}
.quick-due-chips.compact .quick-due-chip {
  padding: 2px 7px !important;
  font-size: 0.72rem !important;
  height: 22px !important;
}
.color-options.compact {
  display: grid !important;
  grid-template-columns: repeat(5, 24px) !important;
  gap: 6px !important;
  margin-top: 4px !important;
}
.color-options.compact .color-option {
  width: 24px !important;
  height: 24px !important;
}

/* 充裕的内容编辑器 */
.memo-editor-group {
  margin-bottom: 0 !important;
}
.memo-text-editor.full-featured {
  display: flex !important;
  flex-direction: column !important;
  border: 1px solid var(--ui-border, #cbd5e1) !important;
  border-radius: 10px !important;
  overflow: visible !important;
  background: var(--ui-surface, #ffffff) !important;
}
.memo-editor-topbar {
  display: flex !important;
  flex-direction: column !important;
  border-bottom: 1px solid var(--ui-border, #e2e8f0) !important;
  border-radius: 9px 9px 0 0 !important;
}
.memo-editor-toolbar-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 5px 8px 5px 4px !important;
  border-bottom: none !important;
  flex-wrap: wrap !important;
}
.memo-editor-topbar .memo-text-toolbar {
  border-bottom: none !important;
  padding: 2px 4px !important;
  flex-shrink: 0 !important;
}
#memoModal #memoContent {
  min-height: 220px !important;
  height: 240px !important;
  max-height: 50vh !important;
  padding: 12px 14px !important;
  font-size: 0.94rem !important;
  line-height: 1.65 !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  resize: vertical !important;
  background: transparent !important;
}
#memoModal .markdown-preview {
  min-height: 220px !important;
  max-height: 50vh !important;
  padding: 12px 14px !important;
  border: none !important;
  border-radius: 0 !important;
}

/* 深色模式适配 */
html[data-theme='dark'] .memo-toggle-chip {
  background: #182433 !important;
  border-color: #2b3d56 !important;
  color: #94a3b8 !important;
}
html[data-theme='dark'] .memo-toggle-chip:hover {
  background: rgba(59, 130, 246, 0.2) !important;
  border-color: #60a5fa !important;
  color: #93c5fd !important;
}
html[data-theme='dark'] .memo-toggle-chip:has(input:checked) {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10b981 !important;
  color: #34d399 !important;
}
html[data-theme='dark'] .memo-meta-grid {
  background: #111a27 !important;
  border-color: #23354d !important;
}
html[data-theme='dark'] .memo-text-editor.full-featured {
  background: #151f2c !important;
  border-color: #2b3d56 !important;
}
html[data-theme='dark'] .memo-editor-topbar {
  border-bottom-color: #23354d !important;
}
html[data-theme='dark'] .memo-editor-toolbar-row,
html[data-theme='dark'] .memo-editor-topbar .memo-text-toolbar {
  border-bottom-color: #1e2c3d !important;
}
html[data-theme='dark'] .memo-editor-topbar .memo-template-chips-bar {
  background: #111a27 !important;
}

/* 响应式适配移动端 */
@media (max-width: 768px) {
  #memoModal .modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
  }
  .memo-title-row-compact {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .memo-meta-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  #memoModal #memoContent {
    min-height: 180px !important;
    height: 200px !important;
  }
}

/* ================= 顶栏与弹窗一键自动结转待办按钮 ================= */
.btn-quick-carryover {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  height: 36px !important;
  padding: 0 12px !important;
  border-radius: 9px !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  background: var(--ui-surface, #ffffff) !important;
  color: #059669 !important;
  transition: all 0.15s ease !important;
  flex-shrink: 0 !important;
}
.btn-quick-carryover:hover {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: #10b981 !important;
  transform: translateY(-1px) !important;
}
html[data-theme='dark'] .btn-quick-carryover {
  background: #182433 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #34d399 !important;
}
html[data-theme='dark'] .btn-quick-carryover:hover {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10b981 !important;
}
@media (max-width: 768px) {
  .btn-quick-carryover {
    display: none !important;
  }
}

.btn-daily-carryover {
  color: #059669 !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
  font-weight: 600 !important;
}
.btn-daily-carryover:hover {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: #10b981 !important;
  color: #047857 !important;
}
html[data-theme='dark'] .btn-daily-carryover {
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
}

/* ================= 事项提醒窗口内审阅与点赞互动动态展示 ================= */
.reminder-notifs-box {
  margin-bottom: 12px !important;
  padding: 10px 12px !important;
  background: rgba(59, 130, 246, 0.05) !important;
  border: 1px solid rgba(59, 130, 246, 0.25) !important;
  border-radius: 10px !important;
}
.reminder-notifs-head {
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  color: var(--ui-text, #1e293b) !important;
  margin-bottom: 8px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.reminder-notifs-items {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}
.reminder-notif-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  padding: 8px 10px !important;
  background: var(--ui-surface, #ffffff) !important;
  border: 1px solid var(--ui-border, #e2e8f0) !important;
  border-radius: 8px !important;
  transition: all 0.15s ease !important;
}
.reminder-notif-item.review {
  border-left: 3px solid #10b981 !important;
}
.reminder-notif-item.like {
  border-left: 3px solid #f59e0b !important;
}
.reminder-notif-item.urge {
  border-left: 3px solid #ef4444 !important;
}
.notif-icon-col {
  font-size: 1.1rem !important;
  margin-top: 2px !important;
  flex-shrink: 0 !important;
}
.notif-content-col {
  flex: 1 1 auto !important;
}
.notif-item-title {
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  color: var(--ui-text, #1e293b) !important;
  margin-bottom: 2px !important;
}
.notif-item-desc {
  font-size: 0.82rem !important;
  color: var(--ui-text-muted, #475569) !important;
  line-height: 1.4 !important;
}
.notif-item-meta {
  font-size: 0.72rem !important;
  color: var(--ui-text-muted, #94a3b8) !important;
  margin-top: 2px !important;
}
html[data-theme='dark'] .reminder-notifs-box {
  background: rgba(30, 41, 59, 0.6) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}
html[data-theme='dark'] .reminder-notif-item {
  background: #151f2c !important;
  border-color: #2b3d56 !important;
}
html[data-theme='dark'] .notif-item-title {
  color: #f1f5f9 !important;
}
html[data-theme='dark'] .notif-item-desc {
  color: #cbd5e1 !important;
}

/* ========================================================
   桌面端全屏自适应一屏月历布局 (Single-Screen Full-Month Calendar)
   - 移除旧版 aspect-ratio: 1 导致的宽屏巨型正方形拉伸
   - 员工端 1个月 / 2个月 视图自动贴合 100vh 一屏展示全部日期行，免上下滚动
   ======================================================== */
@media (min-width: 769px) {
  .app-main:has(#teamLeaderboard[hidden]) .calendar-day,
  .app-main:has(#teamLeaderboard[hidden]) .multi-month-calendar.grid-1 .calendar-day,
  .app-main:has(#teamLeaderboard[hidden]) .month-calendar.small .calendar-day {
    aspect-ratio: auto !important;
    min-height: 100px !important;
    padding: 6px 8px !important;
  }

  .app-main:has(#teamLeaderboard[hidden]) .calendar-day .day-memos {
    min-height: 0 !important;
    max-height: none !important;
    flex: 1 1 0 !important;
  }

  .app-main:has(#teamLeaderboard[hidden]) .multi-month-calendar,
  .app-main:has(#teamLeaderboard[hidden]) .month-calendar,
  .app-main:has(#teamLeaderboard[hidden]) .month-calendar.small {
    min-height: 0 !important;
  }
}

@media (min-width: 769px) and (min-height: 620px) {
  .app-layout:has(.app-main #dashboardPage[hidden]):has(.app-main #weeklyPlanPage[hidden]):has(.app-main #teamLeaderboard[hidden]):has(#multiMonthCalendar:is(.grid-1, .grid-2)) {
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 100vh !important;
    overflow: hidden !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]):has(#multiMonthCalendar:is(.grid-1, .grid-2)) {
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]):has(#multiMonthCalendar:is(.grid-1, .grid-2)) > .app-header {
    flex: 0 0 52px !important;
    height: 52px !important;
    min-height: 52px !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]):has(#multiMonthCalendar:is(.grid-1, .grid-2)) > .app-body {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    padding: 8px 18px 10px !important;
    gap: 6px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]):has(#multiMonthCalendar:is(.grid-1, .grid-2)) .calendar-container {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    gap: 6px !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]):has(#multiMonthCalendar:is(.grid-1, .grid-2)) .calendar-nav-wrap {
    flex: 0 0 auto !important;
    margin: 0 !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]):has(#multiMonthCalendar:is(.grid-1, .grid-2)) #calendarNavigation {
    padding: 3px 14px !important;
    gap: 8px !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]):has(#multiMonthCalendar:is(.grid-1, .grid-2)) #calendarNavigation .current-period {
    font-size: 1.02rem !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]):has(#multiMonthCalendar:is(.grid-1, .grid-2)) #calendarNavigation .nav-button:not(.today-btn) {
    width: 28px !important;
    height: 28px !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]):has(#multiMonthCalendar:is(.grid-1, .grid-2)) #calendarNavigation :is(.today-btn, #goTodayBtn) {
    height: 28px !important;
    min-width: 58px !important;
    padding: 0 12px !important;
    font-size: 0.82rem !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]) #multiMonthCalendar:is(.grid-1, .grid-2) {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    gap: 14px !important;
    grid-auto-rows: minmax(0, 1fr) !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]) #multiMonthCalendar:is(.grid-1, .grid-2) .month-calendar {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    padding: 10px 14px !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]) #multiMonthCalendar:is(.grid-1, .grid-2) .month-header {
    flex: 0 0 auto !important;
    padding: 0 0 6px !important;
    margin-bottom: 6px !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]) #multiMonthCalendar:is(.grid-1, .grid-2) .month-title {
    font-size: 1.18rem !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]) #multiMonthCalendar:is(.grid-1, .grid-2) .weekdays {
    flex: 0 0 auto !important;
    padding-bottom: 4px !important;
    margin-bottom: 5px !important;
    gap: 5px !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]) #multiMonthCalendar:is(.grid-1, .grid-2) .weekdays div {
    padding: 4px 0 !important;
    font-size: 0.78rem !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]) #multiMonthCalendar:is(.grid-1, .grid-2) .calendar-grid {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    grid-auto-rows: minmax(0, 1fr) !important;
    gap: 5px !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]) #multiMonthCalendar:is(.grid-1, .grid-2) .calendar-day {
    aspect-ratio: auto !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 5px 7px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]) #multiMonthCalendar:is(.grid-1, .grid-2) .calendar-day .day-number {
    flex: 0 0 auto !important;
    min-height: 18px !important;
    margin-bottom: 2px !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]) #multiMonthCalendar:is(.grid-1, .grid-2) .calendar-day .day-number-text {
    font-size: 0.86rem !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]) #multiMonthCalendar:is(.grid-1, .grid-2) .calendar-day .day-memos {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    gap: 2px !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]) #multiMonthCalendar:is(.grid-1, .grid-2) .calendar-day .day-memo-item {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 20px !important;
    max-height: 24px !important;
    padding: 2px 6px !important;
    margin-bottom: 2px !important;
    font-size: 0.78rem !important;
    line-height: 1.3 !important;
  }
}

/* 单月视图 (grid-1) 下将月份切换器内嵌至日历卡片头部正中央，释放顶部行空间让日历格子更高 */
@media (min-width: 1024px) {
  .calendar-container:has(#multiMonthCalendar.grid-1) {
    position: relative !important;
    gap: 0 !important;
  }

  .calendar-container:has(#multiMonthCalendar.grid-1) > .calendar-nav-wrap {
    position: absolute !important;
    top: 14px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    height: 38px !important;
    margin: 0 !important;
    z-index: 15 !important;
    pointer-events: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .calendar-container:has(#multiMonthCalendar.grid-1) > .calendar-nav-wrap #calendarNavigation {
    pointer-events: auto !important;
  }

  .calendar-container:has(#multiMonthCalendar.grid-1) #multiMonthCalendar.grid-1 > .month-calendar > .month-header {
    min-height: 38px !important;
    align-items: center !important;
  }
}

@media (min-width: 1024px) and (min-height: 620px) {
  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]) .calendar-container:has(#multiMonthCalendar.grid-1) > .calendar-nav-wrap {
    top: 9px !important;
    height: 36px !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]) #multiMonthCalendar.grid-1 > .month-calendar {
    padding: 9px 14px 10px !important;
  }

  .app-main:has(#dashboardPage[hidden]):has(#weeklyPlanPage[hidden]):has(#teamLeaderboard[hidden]) #multiMonthCalendar.grid-1 > .month-calendar > .month-header {
    min-height: 36px !important;
    padding: 0 0 7px !important;
    margin-bottom: 6px !important;
    align-items: center !important;
  }
}

/* ================= 2026-09 四合一高阶 UI 质感与交互升级 ================= */

/* 1. 日历任务条 (.day-memo-item) 进行中 vs 已完成 视觉层次强化 */
.calendar-day .day-memo-item.pending {
  border-left: 3px solid var(--memo-color, #3b82f6) !important;
  background: rgba(248, 250, 252, 0.92) !important;
  font-weight: 500 !important;
}

html[data-theme='dark'] .calendar-day .day-memo-item.pending {
  border-left: 3px solid var(--memo-color, #60a5fa) !important;
  background: rgba(30, 41, 59, 0.88) !important;
}

.calendar-day .day-memo-item.is-overdue {
  border-left: 3px solid #ef4444 !important;
  background: rgba(254, 242, 242, 0.85) !important;
}

html[data-theme='dark'] .calendar-day .day-memo-item.is-overdue {
  border-left: 3px solid #f87171 !important;
  background: rgba(127, 29, 29, 0.28) !important;
}

.calendar-day .day-memo-item.completed {
  border-left: 3px solid rgba(16, 185, 129, 0.65) !important;
  background: rgba(240, 253, 244, 0.55) !important;
  opacity: 0.86 !important;
}

.calendar-day .day-memo-item.completed .memo-title-text {
  text-decoration: line-through;
  text-decoration-color: rgba(100, 116, 139, 0.6);
  color: #64748b !important;
}

html[data-theme='dark'] .calendar-day .day-memo-item.completed {
  border-left: 3px solid rgba(100, 116, 139, 0.45) !important;
  background: rgba(30, 41, 59, 0.45) !important;
  opacity: 0.72 !important;
}

html[data-theme='dark'] .calendar-day .day-memo-item.completed .memo-title-text {
  color: #64748b !important;
  text-decoration-color: rgba(100, 116, 139, 0.55);
}

/* 2. 毛玻璃悬浮详情预览卡 (#memoHoverTooltip) 升级 */
.memo-hover-tooltip {
  width: 400px !important;
  max-width: calc(100vw - 24px) !important;
  box-sizing: border-box !important;
  padding: 12px 13px !important;
  border-radius: 14px !important;
  border-top: 3px solid var(--mht-accent, #3b82f6) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  box-shadow: 0 18px 42px -8px rgba(15, 23, 42, 0.22), 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme='dark'] .memo-hover-tooltip {
  background: rgba(15, 23, 42, 0.95) !important;
  border-top: 3px solid var(--mht-accent, #60a5fa) !important;
  box-shadow: 0 20px 46px -8px rgba(0, 0, 0, 0.68), 0 0 0 1px rgba(51, 65, 85, 0.8) !important;
}

.mht-top-tags {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  margin-bottom: 7px;
}

.mht-kind-tag,
.mht-owner-tag,
.mht-badge,
.mht-stamp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap !important;
  flex-shrink: 0;
  line-height: 1.2;
}

.mht-kind-tag.is-plan {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}

.mht-kind-tag.is-memo {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
}

.mht-owner-tag {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  min-width: 0;
  flex-shrink: 1;
}

.mht-owner-tag i {
  flex-shrink: 0;
}

.mht-owner-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme='dark'] .mht-kind-tag.is-plan {
  background: rgba(129, 140, 248, 0.2);
  color: #a5b4fc;
}

html[data-theme='dark'] .mht-kind-tag.is-memo {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
}

html[data-theme='dark'] .mht-owner-tag {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.mht-title.is-completed {
  text-decoration: line-through;
  opacity: 0.78;
}

.mht-content {
  -webkit-line-clamp: 4 !important;
  background: rgba(248, 250, 252, 0.8);
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid rgba(226, 232, 240, 0.7);
  margin-top: 6px !important;
}

html[data-theme='dark'] .mht-content {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(51, 65, 85, 0.7);
}

.mht-edit-hint {
  font-size: 0.7rem;
  color: #3b82f6;
  font-weight: 600;
  white-space: nowrap;
}

html[data-theme='dark'] .mht-edit-hint {
  color: #60a5fa;
}

.mht-actions-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 5px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.mht-actions-left,
.mht-react-bar {
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  flex-shrink: 0 !important;
  gap: 4px !important;
  max-width: 100% !important;
}

.mht-btn-complete,
.mht-btn-carryover,
.mht-btn-react {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  height: 26px !important;
  padding: 0 7px !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  border-radius: 6px !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mht-btn-complete {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.mht-btn-complete:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-1px);
}

.mht-btn-complete.is-done {
  color: #64748b;
  background: rgba(100, 116, 139, 0.12);
  border-color: rgba(100, 116, 139, 0.3);
}

.mht-btn-complete.is-done:hover {
  background: #475569;
  color: #ffffff;
  border-color: #475569;
}

html[data-theme='dark'] .mht-btn-complete {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.35);
}

html[data-theme='dark'] .mht-btn-complete:hover {
  background: #3b82f6;
  color: #ffffff;
}

/* 3. 侧栏收起态即时悬浮气泡 (#sidebarHoverTooltip) */
.sidebar-hover-tooltip {
  position: fixed;
  z-index: 100000;
  pointer-events: none;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transform: translateY(-50%) translateX(-6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s cubic-bezier(0.16, 1, 0.3, 1), transform 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-hover-tooltip::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: rgba(15, 23, 42, 0.94);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-hover-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* 4. 双月视图 (.grid-2) 顶部空间进一步紧凑化 */
@media (min-width: 1024px) {
  .calendar-container:has(#multiMonthCalendar.grid-2) {
    gap: 4px !important;
  }

  .calendar-container:has(#multiMonthCalendar.grid-2) > .calendar-nav-wrap {
    margin: 0 auto 2px !important;
    min-height: 28px !important;
  }

  .calendar-container:has(#multiMonthCalendar.grid-2) #calendarNavigation {
    padding: 2px 12px !important;
    min-height: 28px !important;
    border-radius: 999px !important;
  }

  .calendar-container:has(#multiMonthCalendar.grid-2) #multiMonthCalendar.grid-2 > .month-calendar {
    padding: 8px 12px 10px !important;
  }

  .calendar-container:has(#multiMonthCalendar.grid-2) #multiMonthCalendar.grid-2 > .month-calendar > .month-header {
    padding: 0 0 5px !important;
    margin-bottom: 5px !important;
    min-height: 30px !important;
  }
}

/* 5. 周计划每日完成进度条与拖拽改期交互 + 研发大屏环形图与脉冲高亮 */
.wp-day-count-badge.all-done {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #059669 !important;
  font-weight: 700 !important;
}

html[data-theme='dark'] .wp-day-count-badge.all-done {
  background: rgba(52, 211, 153, 0.2) !important;
  color: #34d399 !important;
}

.wp-day-progress-track {
  height: 3px;
  width: 100%;
  background: rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  overflow: hidden;
  margin: -2px 0 8px;
}

.wp-day-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.wp-day-progress-fill.is-complete {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.wp-day-task-card[draggable="true"] {
  cursor: grab;
}

.wp-day-task-card.is-dragging {
  opacity: 0.45 !important;
  transform: scale(0.97) !important;
  cursor: grabbing !important;
}

.wp-day-column.is-drag-over {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
  background: rgba(59, 130, 246, 0.04) !important;
}

html[data-theme='dark'] .wp-day-column.is-drag-over {
  border-color: #60a5fa !important;
  background: rgba(59, 130, 246, 0.1) !important;
}

.wp-drop-sub {
  display: block;
  margin-top: 4px;
  font-size: 0.7rem;
  opacity: 0.65;
}

/* ==========================================================================
   Functions Modal – unified workbench visual language
   ========================================================================== */
html[data-theme] #functionsModal .modal-content {
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 14px !important;
  box-shadow: var(--ui-shell-shadow) !important;
  overflow: hidden !important;
}

html[data-theme] #functionsModal .modal-header {
  min-height: 48px !important;
  padding: 10px 16px !important;
  background: var(--ui-surface) !important;
  border-bottom: 1px solid var(--ui-border) !important;
}

html[data-theme] #functionsModal .modal-title {
  color: var(--ui-text) !important;
  font-size: 1.06rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
}

html[data-theme] #functionsModal .close-modal {
  width: 34px !important;
  height: 34px !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 9px !important;
  background: var(--ui-surface-soft) !important;
  color: var(--ui-text-muted) !important;
  box-shadow: none !important;
}

html[data-theme] #functionsModal .close-modal:hover {
  background: var(--ui-surface-hover) !important;
  color: var(--ui-text) !important;
}

html[data-theme] #functionsModal .modal-body {
  padding: 14px 16px 18px !important;
  background: var(--ui-surface) !important;
  color: var(--ui-text) !important;
}

html[data-theme] #functionsModal .tabs {
  display: flex !important;
  width: 100% !important;
  gap: 4px !important;
  padding: 4px !important;
  margin: 0 0 16px !important;
  overflow: visible !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 10px !important;
  background: var(--ui-surface-soft) !important;
  box-shadow: none !important;
}

html[data-theme] #functionsModal .tab {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  min-height: 36px !important;
  padding: 7px 6px !important;
  border: 1px solid transparent !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: var(--ui-text-muted) !important;
  box-shadow: none !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
}

html[data-theme] #functionsModal .tab:hover {
  background: var(--ui-surface-hover) !important;
  color: var(--ui-text) !important;
}

html[data-theme] #functionsModal .tab.active {
  background: var(--ui-accent-soft) !important;
  border-color: transparent !important;
  color: var(--ui-accent) !important;
  box-shadow: none !important;
}

html[data-theme] #functionsModal .tab-content > h3,
html[data-theme] #functionsModal .ops-monitor-header h3 {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  margin: 2px 0 12px !important;
  color: var(--ui-text) !important;
  font-size: 0.98rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

html[data-theme] #functionsModal .tab-content > h3 i,
html[data-theme] #functionsModal .ops-monitor-header h3 i {
  color: var(--ui-accent) !important;
  font-size: 0.9rem !important;
}

html[data-theme] #functionsModal #dataManagementTab > p,
html[data-theme] #functionsModal .ops-monitor-header p {
  color: var(--ui-text-muted) !important;
  font-size: 0.84rem !important;
  line-height: 1.55 !important;
}

html[data-theme] #functionsModal .form-group {
  margin-bottom: 12px !important;
}

html[data-theme] #functionsModal .form-group > label,
html[data-theme] #functionsModal .excel-export-grid label > span {
  margin-bottom: 5px !important;
  color: var(--ui-text-muted) !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
}

html[data-theme] #functionsModal .form-control,
html[data-theme] #functionsModal .excel-export-grid :is(input, select) {
  min-height: 40px !important;
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border-strong) !important;
  border-radius: 8px !important;
  color: var(--ui-text) !important;
  box-shadow: none !important;
}

html[data-theme] #functionsModal .form-control:focus,
html[data-theme] #functionsModal .excel-export-grid :is(input, select):focus {
  border-color: var(--ui-accent) !important;
  outline: 2px solid var(--ui-focus-ring) !important;
  outline-offset: 0 !important;
}

html[data-theme] #functionsModal :is(
  .task-assignee-panel,
  .task-publish-info,
  .export-info,
  .excel-export-panel,
  .data-stats-card,
  .ops-card
) {
  background: var(--ui-surface-soft) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

html[data-theme] #functionsModal :is(
  .task-publish-info,
  .export-info,
  .excel-export-panel,
  .data-stats-card,
  .ops-card
) {
  padding: 12px 14px !important;
}

html[data-theme] #functionsModal :is(
  .task-publish-info,
  .export-info,
  .excel-export-panel,
  .data-stats-card
) h4 {
  margin: 0 0 5px !important;
  color: var(--ui-text) !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
}

html[data-theme] #functionsModal :is(
  .task-publish-info,
  .export-info,
  .excel-export-panel,
  .data-stats-card
) :is(p, li) {
  color: var(--ui-text-muted) !important;
  font-size: 0.8rem !important;
  line-height: 1.5 !important;
}

html[data-theme] #functionsModal .task-assignee-panel {
  padding: 10px !important;
}

html[data-theme] #functionsModal :is(.task-assignee-mode, .btn-assignee-quick) {
  border: 1px solid var(--ui-border) !important;
  border-radius: 7px !important;
  background: var(--ui-surface) !important;
  color: var(--ui-text-muted) !important;
  box-shadow: none !important;
}

html[data-theme] #functionsModal .task-assignee-mode.active {
  border-color: transparent !important;
  background: var(--ui-accent-soft) !important;
  color: var(--ui-accent) !important;
}

html[data-theme] #functionsModal .btn {
  min-height: 38px !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}

html[data-theme] #functionsModal :is(#publishTask, #saveReminderSettings) {
  background: var(--ui-button-bg) !important;
  border-color: transparent !important;
  color: var(--ui-button-text) !important;
}

html[data-theme] #functionsModal :is(#publishTask, #saveReminderSettings):hover {
  background: var(--ui-button-hover) !important;
}

html[data-theme] #functionsModal #testReminder {
  background: var(--ui-surface-soft) !important;
  border: 1px solid var(--ui-border) !important;
  color: var(--ui-text) !important;
}

html[data-theme] #functionsModal #testReminder:hover {
  background: var(--ui-surface-hover) !important;
}

html[data-theme] #functionsModal #reminderSettingsTab .form-group:has(input[type='checkbox']) {
  padding: 10px 12px !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 10px !important;
  background: var(--ui-surface-soft) !important;
}

html[data-theme] #functionsModal #reminderSettingsTab .form-group:has(input[type='checkbox']) > label {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  color: var(--ui-text) !important;
  font-weight: 500 !important;
}

html[data-theme] #functionsModal input[type='checkbox'] {
  accent-color: var(--ui-accent);
}

html[data-theme] #functionsModal #desktopNotificationStatus {
  color: var(--ui-text-muted) !important;
}

html[data-theme] #functionsModal .modal-footer {
  padding: 10px 16px !important;
  background: var(--ui-surface) !important;
  border-top: 1px solid var(--ui-border) !important;
}

@media (max-width: 768px) {
  html[data-theme] #functionsModal .modal-content {
    width: calc(100% - 20px) !important;
    max-width: 560px !important;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 20px) !important;
    border-radius: 14px !important;
  }

  html[data-theme] #functionsModal .modal-header {
    min-height: 46px !important;
    padding: 8px 12px !important;
  }

  html[data-theme] #functionsModal .modal-body {
    padding: 10px 12px calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    overscroll-behavior-y: contain !important;
  }

  html[data-theme] #functionsModal .tabs {
    position: sticky !important;
    top: 0 !important;
    z-index: 3 !important;
    gap: 2px !important;
    padding: 3px !important;
    margin-bottom: 12px !important;
    overflow: visible !important;
    box-shadow: none !important;
  }

  html[data-theme] #functionsModal .tab {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    min-height: 36px !important;
    padding: 7px 2px !important;
    font-size: 0.74rem !important;
    letter-spacing: -0.02em !important;
  }

  html[data-theme] #functionsModal .tab :is(i, svg, .tabler-icon) {
    display: none !important;
  }

  html[data-theme] #functionsModal .form-group {
    margin-bottom: 10px !important;
  }

  html[data-theme] #functionsModal :is(#publishTask, #testReminder, #saveReminderSettings) {
    width: 100% !important;
  }

  html[data-theme] #functionsModal .modal-footer {
    display: none !important;
  }
}

@media (max-width: 380px) {
  html[data-theme] #functionsModal .tab {
    padding-inline: 1px !important;
    font-size: 0.7rem !important;
  }
}

/* ==========================================================================
   R&D Dashboard – 视觉降噪与紧凑化 (Unified Workbench Style)
   ========================================================================== */

/* 1. 顶部横幅精简：去掉多余装饰与重复小标，压成清爽单行顶栏 */
html[data-theme] #dashboardPage .dashboard-hero {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 14px 18px !important;
  margin-bottom: 14px !important;
  border-radius: 12px !important;
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border) !important;
  box-shadow: var(--ui-shell-shadow) !important;
}

html[data-theme] #dashboardPage .dashboard-hero::before,
html[data-theme] #dashboardPage .dashboard-hero::after,
html[data-theme] #dashboardPage .dashboard-kicker {
  display: none !important;
}

html[data-theme] #dashboardPage #dashboardTitle {
  margin: 0 0 2px !important;
  font-size: 1.24rem !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  color: var(--ui-text) !important;
  text-shadow: none !important;
}

html[data-theme] #dashboardPage #dashboardSubtitle {
  margin: 0 !important;
  font-size: 0.8rem !important;
  line-height: 1.4 !important;
  color: var(--ui-text-muted) !important;
}

html[data-theme] #dashboardPage .dashboard-actions .btn {
  min-height: 36px !important;
  padding: 6px 13px !important;
  border-radius: 8px !important;
  font-size: 0.82rem !important;
  box-shadow: none !important;
}

/* 2. 顶部 6 张指标卡：去掉彩虹粗顶条，平时干净克制，仅逾期/临期高亮警示 */
html[data-theme] #dashboardPage .dashboard-metrics {
  gap: 10px !important;
  margin-bottom: 14px !important;
}

html[data-theme] #dashboardPage .dashboard-metric {
  padding: 13px 15px !important;
  border-radius: 12px !important;
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border) !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-theme] #dashboardPage .dashboard-metric::before {
  display: none !important;
}

html[data-theme] #dashboardPage .dashboard-metric:hover {
  border-color: var(--ui-border-strong) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05) !important;
  transform: translateY(-1px) !important;
}

html[data-theme] #dashboardPage .dashboard-metric-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 6px !important;
}

html[data-theme] #dashboardPage .dashboard-metric-label {
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  color: var(--ui-text-muted) !important;
}

html[data-theme] #dashboardPage .dashboard-metric-icon {
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px !important;
  font-size: 0.76rem !important;
  background: var(--ui-surface-soft) !important;
  color: var(--ui-text-muted) !important;
}

html[data-theme] #dashboardPage .dashboard-metric-value {
  font-size: 1.68rem !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  margin-bottom: 4px !important;
  color: var(--ui-text) !important;
  text-shadow: none !important;
}

html[data-theme] #dashboardPage .dashboard-metric-sub {
  font-size: 0.73rem !important;
  color: var(--ui-text-muted) !important;
}

/* 已完成：柔和绿字 */
html[data-theme] #dashboardPage .dashboard-metric.metric-success .dashboard-metric-value {
  color: #059669 !important;
}
html[data-theme='dark'] #dashboardPage .dashboard-metric.metric-success .dashboard-metric-value,
html.dark #dashboardPage .dashboard-metric.metric-success .dashboard-metric-value {
  color: #34d399 !important;
}
html[data-theme] #dashboardPage .dashboard-metric.metric-success .dashboard-metric-icon {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
}
html[data-theme='dark'] #dashboardPage .dashboard-metric.metric-success .dashboard-metric-icon,
html.dark #dashboardPage .dashboard-metric.metric-success .dashboard-metric-icon {
  color: #34d399 !important;
}

/* 仅当逾期 > 0 (metric-danger) 或临期 > 0 (metric-warning) 时才高亮边框与数字 */
html[data-theme='light'] #dashboardPage .dashboard-metric.metric-danger,
html.light #dashboardPage .dashboard-metric.metric-danger {
  border-color: #fecdd3 !important;
  background: linear-gradient(180deg, #fff5f5 0%, #ffffff 75%) !important;
}
html[data-theme='dark'] #dashboardPage .dashboard-metric.metric-danger,
html.dark #dashboardPage .dashboard-metric.metric-danger {
  border-color: rgba(244, 63, 94, 0.4) !important;
  background: linear-gradient(180deg, rgba(136, 19, 55, 0.24) 0%, rgba(15, 23, 42, 0.9) 75%) !important;
}
html[data-theme] #dashboardPage .dashboard-metric.metric-danger .dashboard-metric-value {
  color: #dc2626 !important;
}
html[data-theme='dark'] #dashboardPage .dashboard-metric.metric-danger .dashboard-metric-value,
html.dark #dashboardPage .dashboard-metric.metric-danger .dashboard-metric-value {
  color: #fb7185 !important;
}
html[data-theme] #dashboardPage .dashboard-metric.metric-danger .dashboard-metric-icon {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #dc2626 !important;
}

html[data-theme='light'] #dashboardPage .dashboard-metric.metric-warning,
html.light #dashboardPage .dashboard-metric.metric-warning {
  border-color: #fde68a !important;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 75%) !important;
}
html[data-theme='dark'] #dashboardPage .dashboard-metric.metric-warning,
html.dark #dashboardPage .dashboard-metric.metric-warning {
  border-color: rgba(245, 158, 11, 0.35) !important;
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.22) 0%, rgba(15, 23, 42, 0.9) 75%) !important;
}
html[data-theme] #dashboardPage .dashboard-metric.metric-warning .dashboard-metric-value {
  color: #d97706 !important;
}
html[data-theme='dark'] #dashboardPage .dashboard-metric.metric-warning .dashboard-metric-value,
html.dark #dashboardPage .dashboard-metric.metric-warning .dashboard-metric-value {
  color: #fbbf24 !important;
}
html[data-theme] #dashboardPage .dashboard-metric.metric-warning .dashboard-metric-icon {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #d97706 !important;
}

/* 3. 人员负载：分段真实进度条 + 零值胶囊隐藏 + 100% 全达成紧凑双列区 */
html[data-theme] #dashboardPage .dashboard-card {
  padding: 16px 18px !important;
  border-radius: 12px !important;
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border) !important;
  box-shadow: var(--ui-shell-shadow) !important;
}

html[data-theme] #dashboardPage .dashboard-card-title {
  margin-bottom: 12px !important;
  padding-bottom: 10px !important;
  border-bottom: 1px solid var(--ui-border) !important;
}

html[data-theme] #dashboardPage .dashboard-user-row {
  padding: 11px 13px !important;
  margin-bottom: 8px !important;
  border-radius: 10px !important;
  background: var(--ui-surface-soft) !important;
  border: 1px solid var(--ui-border) !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-theme] #dashboardPage .dashboard-user-row:hover {
  background: var(--ui-surface-hover) !important;
  border-color: var(--ui-border-strong) !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-theme] #dashboardPage .dashboard-progress {
  display: flex !important;
  align-items: stretch !important;
  height: 6px !important;
  margin-bottom: 7px !important;
  border-radius: 999px !important;
  background: rgba(148, 163, 184, 0.18) !important;
  overflow: hidden !important;
}

html[data-theme] #dashboardPage .dashboard-progress-fill.fill-normal {
  height: 100% !important;
  width: var(--dashboard-rate, 0%) !important;
  border-radius: 0 !important;
  background: linear-gradient(90deg, #0284c7, #10b981) !important;
}

html[data-theme] #dashboardPage .dashboard-progress-overdue {
  height: 100% !important;
  background: #ef4444 !important;
  flex-shrink: 0 !important;
}

/* 100% 全达成分组标题与紧凑双列网格 */
html[data-theme] #dashboardPage .dashboard-user-group-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 4px 2px 8px !important;
  color: var(--ui-text-muted) !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
}

html[data-theme] #dashboardPage .dashboard-user-group-header.has-top-gap {
  margin-top: 12px !important;
  padding-top: 12px !important;
  border-top: 1px dashed var(--ui-border) !important;
}

html[data-theme] #dashboardPage .dashboard-user-group-header span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

html[data-theme] #dashboardPage .dashboard-user-group-header i {
  color: #10b981 !important;
}

html[data-theme] #dashboardPage .dashboard-user-group-header small {
  font-size: 0.72rem !important;
  font-weight: 500 !important;
  color: var(--ui-text-muted) !important;
}

html[data-theme] #dashboardPage .dashboard-completed-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

html[data-theme] #dashboardPage .dashboard-user-row.is-compact {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 8px 11px !important;
  margin-bottom: 0 !important;
}

html[data-theme] #dashboardPage .dashboard-user-row.is-compact .user-row-avatar {
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  font-size: 0.8rem !important;
}

html[data-theme] #dashboardPage .dashboard-user-row.is-compact .dashboard-user-name {
  font-size: 0.85rem !important;
  margin-bottom: 1px !important;
}

html[data-theme] #dashboardPage .dashboard-user-row.is-compact .user-role-tag {
  font-size: 0.68rem !important;
  padding: 0 5px !important;
}

html[data-theme] #dashboardPage .user-row-compact-meta {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

html[data-theme] #dashboardPage .compact-done-count {
  font-size: 0.73rem !important;
  color: var(--ui-text-muted) !important;
}

html[data-theme] #dashboardPage .dashboard-user-row.is-compact .dashboard-user-rate {
  font-size: 0.92rem !important;
  font-weight: 800 !important;
}

/* 4. 风险提醒卡片：克制底色 + 干净标签 */
html[data-theme] #dashboardPage .dashboard-risk-item {
  padding: 10px 12px !important;
  margin-bottom: 8px !important;
  border-radius: 10px !important;
  background: var(--ui-surface-soft) !important;
  border: 1px solid var(--ui-border) !important;
  border-left-width: 3px !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-theme] #dashboardPage .dashboard-risk-item.risk-danger {
  border-left-color: #ef4444 !important;
}

html[data-theme] #dashboardPage .dashboard-risk-item.risk-warning {
  border-left-color: #f59e0b !important;
}

html[data-theme] #dashboardPage .dashboard-risk-item:hover {
  background: var(--ui-surface-hover) !important;
  border-color: var(--ui-border-strong) !important;
}

html[data-theme] #dashboardPage .risk-badge {
  padding: 2px 7px !important;
  border-radius: 5px !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
}

html[data-theme] #dashboardPage .dashboard-risk-title {
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  color: var(--ui-text) !important;
}

html[data-theme] #dashboardPage .dashboard-risk-meta {
  font-size: 0.75rem !important;
  color: var(--ui-text-muted) !important;
}

@media (max-width: 640px) {
  html[data-theme] #dashboardPage .dashboard-completed-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ========================================================
   研发成果交付与确认闭环 (Deliverable Closed-Loop UI)
   ======================================================== */

/* 1. 月历卡片与周计划卡片单行紧凑成果胶囊 (.memo-delivery-pill) */
.memo-delivery-pill {
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  height: 16px !important;
  padding: 0 5px !important;
  margin-right: 3px !important;
  border-radius: 4px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
}

.memo-delivery-pill.is-submitted {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #b45309 !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
}

.memo-delivery-pill.is-returned {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #dc2626 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

.memo-delivery-pill.is-confirmed {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #059669 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.memo-delivery-pill.is-target {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #2563eb !important;
  border: 1px solid rgba(59, 130, 246, 0.25) !important;
}

html[data-theme='dark'] .memo-delivery-pill.is-submitted {
  background: rgba(245, 158, 11, 0.22) !important;
  color: #fcd34d !important;
  border-color: rgba(245, 158, 11, 0.42) !important;
}

html[data-theme='dark'] .memo-delivery-pill.is-returned {
  background: rgba(239, 68, 68, 0.22) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.42) !important;
}

html[data-theme='dark'] .memo-delivery-pill.is-confirmed {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #6ee7b7 !important;
  border-color: rgba(16, 185, 129, 0.38) !important;
}

html[data-theme='dark'] .memo-delivery-pill.is-target {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, 0.38) !important;
}

/* 待确认与退回修改在月历行上的微边框提示（严格保持单行高度） */
.day-memo-item.delivery-submitted {
  border-left: 2.5px solid #f59e0b !important;
}

.day-memo-item.delivery-returned {
  border-left: 2.5px solid #ef4444 !important;
}

/* 2. 备忘录弹窗内：工具栏右侧内嵌「成果交付」下拉选择栏 (.memo-delivery-bar) 与保存互锁样式 */
.memo-delivery-bar {
  position: relative !important;
  margin: 0 !important;
  padding: 4px 8px !important;
  border-radius: 8px !important;
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.14) 0%, rgba(245, 158, 11, 0.1) 100%) !important;
  border: 2px solid #f97316 !important;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.16) !important;
  flex: 1 1 340px !important;
  transition: all 0.2s ease !important;
}

.memo-delivery-bar.has-value {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%) !important;
  border: 1.5px solid rgba(16, 185, 129, 0.52) !important;
  box-shadow: none !important;
}

html[data-theme='dark'] .memo-delivery-bar {
  background: rgba(249, 115, 22, 0.18) !important;
  border-color: #f97316 !important;
}

html[data-theme='dark'] .memo-delivery-bar.has-value {
  background: rgba(16, 185, 129, 0.14) !important;
  border-color: rgba(16, 185, 129, 0.48) !important;
}

@keyframes deliveryBarShake {
  0%, 100% { transform: translateX(0); }
  18%, 54% { transform: translateX(-6px); }
  36%, 72% { transform: translateX(6px); }
  90% { transform: translateX(-2px); }
}

@keyframes deliveryBarRedPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.22), 0 4px 12px rgba(239, 68, 68, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.42), 0 6px 18px rgba(239, 68, 68, 0.36); }
}

.memo-delivery-bar.is-attention {
  border: 2px solid #ef4444 !important;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.2) 0%, rgba(249, 115, 22, 0.15) 100%) !important;
  animation: deliveryBarShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97), deliveryBarRedPulse 1.15s ease-in-out infinite !important;
}

.memo-delivery-alert-tip {
  position: absolute !important;
  bottom: calc(100% + 7px) !important;
  right: 0 !important;
  z-index: 1400 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 5px 12px !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em !important;
  white-space: nowrap !important;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.42) !important;
  pointer-events: none !important;
  animation: deliveryTipBounce 0.9s ease-in-out infinite !important;
}

.memo-delivery-alert-tip::after {
  content: '' !important;
  position: absolute !important;
  top: 100% !important;
  right: 28px !important;
  border-width: 6px 6px 0 6px !important;
  border-style: solid !important;
  border-color: #dc2626 transparent transparent transparent !important;
}

.memo-delivery-alert-tip[hidden] {
  display: none !important;
}

@keyframes deliveryTipBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .memo-delivery-bar.is-attention,
  .memo-delivery-alert-tip {
    animation: none !important;
  }
}

.memo-delivery-bar-main {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

.memo-delivery-bar-label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  margin: 0 !important;
  font-size: 0.81rem !important;
  font-weight: 800 !important;
  color: #c2410c !important;
  white-space: nowrap !important;
  cursor: pointer !important;
}

.memo-delivery-bar.has-value .memo-delivery-bar-label {
  color: #047857 !important;
}

html[data-theme='dark'] .memo-delivery-bar-label {
  color: #fdba74 !important;
}

html[data-theme='dark'] .memo-delivery-bar.has-value .memo-delivery-bar-label {
  color: #6ee7b7 !important;
}

.delivery-required-star {
  color: #ef4444 !important;
  font-style: normal !important;
  margin-left: 2px !important;
}

.memo-delivery-bar-label .delivery-label-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 6px !important;
  background: linear-gradient(135deg, #f97316, #ef4444) !important;
  color: #ffffff !important;
  font-size: 0.72rem !important;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.32) !important;
}

.memo-delivery-bar.has-value .memo-delivery-bar-label .delivery-label-icon {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 5px rgba(16, 185, 129, 0.28) !important;
}

.memo-delivery-remind-pill {
  display: none !important;
}

.memo-delivery-select-wrap {
  position: relative !important;
  flex: 1 1 215px !important;
  min-width: 195px !important;
  max-width: 100% !important;
}

.custom-delivery-dropdown {
  width: 100% !important;
  position: relative !important;
}

.custom-delivery-btn {
  width: 100% !important;
  height: 30px !important;
  padding: 0 10px !important;
  border-radius: 7px !important;
  font-size: 0.81rem !important;
  font-weight: 700 !important;
  justify-content: space-between !important;
  gap: 8px !important;
  background: #fff7ed !important;
  border: 1.5px solid #ea580c !important;
  color: #c2410c !important;
  box-shadow: 0 1px 3px rgba(234, 88, 12, 0.14) !important;
  transition: all 0.16s ease !important;
}

.memo-delivery-bar.is-attention .custom-delivery-btn {
  background: #fef2f2 !important;
  border-color: #dc2626 !important;
  color: #b91c1c !important;
}

.custom-delivery-btn:hover:not(:disabled) {
  border-color: #dc2626 !important;
  background: #ffedd5 !important;
  color: #9a3412 !important;
}

.custom-delivery-btn.active {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18) !important;
}

.memo-delivery-bar.has-value .custom-delivery-btn {
  border-color: rgba(16, 185, 129, 0.6) !important;
  background: rgba(236, 253, 245, 0.85) !important;
  color: #047857 !important;
  box-shadow: none !important;
}

.memo-delivery-bar.has-value .custom-delivery-btn:hover:not(:disabled) {
  border-color: #10b981 !important;
  background: rgba(209, 250, 229, 0.85) !important;
}

.custom-delivery-btn:disabled {
  opacity: 0.65 !important;
  cursor: not-allowed !important;
}

.custom-delivery-btn .dropdown-btn-text {
  flex: 1 1 auto !important;
  text-align: left !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.custom-delivery-menu {
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  min-width: 220px !important;
  max-width: 100% !important;
  top: calc(100% + 5px) !important;
  z-index: 1350 !important;
  padding: 5px !important;
  border-radius: 10px !important;
  background: var(--ui-surface, #ffffff) !important;
  border: 1.5px solid rgba(249, 115, 22, 0.45) !important;
  box-shadow: 0 14px 32px -6px rgba(15, 23, 42, 0.22), 0 4px 12px -2px rgba(15, 23, 42, 0.1) !important;
}

.custom-delivery-menu .custom-dropdown-list {
  max-height: 220px !important;
  overflow-y: auto !important;
  gap: 2px !important;
}

.custom-delivery-menu .custom-dropdown-item {
  padding: 7px 10px !important;
  border-radius: 7px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
}

.custom-delivery-menu .custom-dropdown-item .item-name {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

html[data-theme='dark'] .custom-delivery-btn {
  background: rgba(154, 52, 18, 0.28) !important;
  color: #fdba74 !important;
  border-color: #f97316 !important;
}

html[data-theme='dark'] .memo-delivery-bar.has-value .custom-delivery-btn {
  background: rgba(6, 78, 59, 0.45) !important;
  border-color: rgba(16, 185, 129, 0.52) !important;
  color: #6ee7b7 !important;
}

html[data-theme='dark'] .custom-delivery-menu {
  background: #1e293b !important;
  border-color: rgba(249, 115, 22, 0.45) !important;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.48) !important;
}

/* 底部保存备忘录按钮互锁醒目状态 */
#saveMemo.is-interlocked {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%) !important;
  border-color: #ea580c !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.32) !important;
}

#saveMemo.is-interlocked:hover {
  background: linear-gradient(135deg, #d97706 0%, #c2410c 100%) !important;
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.42) !important;
}

#saveMemo.is-interlock-alert {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.28), 0 6px 16px rgba(220, 38, 38, 0.4) !important;
  animation: deliveryBarShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) !important;
}

.memo-delivery-status-badge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 3px 8px !important;
  border-radius: 999px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}

.memo-delivery-status-badge[hidden] {
  display: none !important;
}

.memo-delivery-status-badge.status-submitted {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #b45309 !important;
}

.memo-delivery-status-badge.status-returned {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #dc2626 !important;
}

.memo-delivery-status-badge.status-confirmed {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #059669 !important;
}

html[data-theme='dark'] .memo-delivery-status-badge.status-submitted {
  color: #fcd34d !important;
}
html[data-theme='dark'] .memo-delivery-status-badge.status-returned {
  color: #fca5a5 !important;
}
html[data-theme='dark'] .memo-delivery-status-badge.status-confirmed {
  color: #6ee7b7 !important;
}

.memo-delivery-review-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  padding: 6px 12px !important;
  background: rgba(239, 68, 68, 0.08) !important;
  border-bottom: 1px dashed rgba(239, 68, 68, 0.35) !important;
}

.memo-delivery-review-row[hidden] {
  display: none !important;
}

.memo-delivery-review-comment {
  font-size: 0.78rem !important;
  color: #dc2626 !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
}

html[data-theme='dark'] .memo-delivery-review-comment {
  color: #fca5a5 !important;
}

.memo-delivery-review-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.memo-delivery-review-actions[hidden] {
  display: none !important;
}

html[data-theme] #memoModal #saveMemo:disabled {
  background: #94a3b8 !important;
  border-color: #94a3b8 !important;
  color: #f8fafc !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  opacity: 0.78 !important;
}

html[data-theme='dark'] #memoModal #saveMemo:disabled {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #94a3b8 !important;
}

.btn-delivery-confirm,
.btn-delivery-return {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  height: 32px !important;
  padding: 0 11px !important;
  border-radius: 7px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
}

.btn-delivery-confirm {
  background: #10b981 !important;
  color: #ffffff !important;
  border: 1px solid #059669 !important;
}

.btn-delivery-confirm:hover {
  background: #059669 !important;
}

.btn-delivery-return {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #dc2626 !important;
  border: 1px solid rgba(239, 68, 68, 0.32) !important;
}

.btn-delivery-return:hover {
  background: rgba(239, 68, 68, 0.18) !important;
}

html[data-theme='dark'] .btn-delivery-return {
  color: #fca5a5 !important;
}

/* 3. 悬浮预览卡片 (#memoHoverTooltip) 成果展示盒与一键确认/退回按钮 */
.mht-badge.submitted {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #b45309 !important;
  border: 1px solid rgba(245, 158, 11, 0.32) !important;
}

.mht-badge.returned {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #dc2626 !important;
  border: 1px solid rgba(239, 68, 68, 0.32) !important;
}

html[data-theme='dark'] .mht-badge.submitted {
  color: #fcd34d !important;
}

html[data-theme='dark'] .mht-badge.returned {
  color: #fca5a5 !important;
}

.mht-delivery-box {
  margin: 6px 0 8px !important;
  padding: 7px 9px !important;
  border-radius: 8px !important;
  background: var(--ui-surface-soft, #f8fafc) !important;
  border: 1px solid var(--ui-border, #e2e8f0) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.mht-delivery-row {
  display: flex !important;
  align-items: baseline !important;
  gap: 6px !important;
  font-size: 0.76rem !important;
  line-height: 1.35 !important;
}

.mht-delivery-k {
  flex-shrink: 0 !important;
  font-weight: 700 !important;
  color: var(--ui-text-muted, #64748b) !important;
}

.mht-delivery-v {
  color: var(--ui-text, #0f172a) !important;
  word-break: break-word !important;
}

.mht-delivery-v.is-filled {
  font-weight: 600 !important;
  color: #059669 !important;
}

html[data-theme='dark'] .mht-delivery-v.is-filled {
  color: #6ee7b7 !important;
}

.mht-delivery-v.is-empty {
  color: var(--ui-text-muted, #94a3b8) !important;
  font-style: italic !important;
}

.mht-delivery-row.is-comment .mht-delivery-v {
  color: #dc2626 !important;
  font-weight: 600 !important;
}

html[data-theme='dark'] .mht-delivery-row.is-comment .mht-delivery-v {
  color: #fca5a5 !important;
}

.mht-btn-confirm,
.mht-btn-return,
.mht-btn-submit-delivery {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  height: 26px !important;
  padding: 0 7px !important;
  border-radius: 6px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.mht-btn-confirm {
  background: #10b981 !important;
  color: #ffffff !important;
  border: 1px solid #059669 !important;
}

.mht-btn-confirm:hover {
  background: #059669 !important;
}

.mht-btn-return {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #dc2626 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.mht-btn-return:hover {
  background: rgba(239, 68, 68, 0.18) !important;
}

html[data-theme='dark'] .mht-btn-return {
  color: #fca5a5 !important;
}

.mht-btn-submit-delivery {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #b45309 !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
}

.mht-btn-submit-delivery:hover {
  background: rgba(245, 158, 11, 0.24) !important;
}

html[data-theme='dark'] .mht-btn-submit-delivery {
  color: #fcd34d !important;
}

/* 4. 研发大屏与当日详情列表的成果状态胶囊 */
html[data-theme] #dashboardPage .stat-pill.pill-submitted {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #b45309 !important;
  border-color: rgba(245, 158, 11, 0.32) !important;
}

html[data-theme='dark'] #dashboardPage .stat-pill.pill-submitted {
  color: #fcd34d !important;
}

html[data-theme] #dashboardPage .stat-pill.pill-returned {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #dc2626 !important;
  border-color: rgba(239, 68, 68, 0.32) !important;
}

html[data-theme='dark'] #dashboardPage .stat-pill.pill-returned {
  color: #fca5a5 !important;
}

.task-status-pill.submitted {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #b45309 !important;
}

.task-status-pill.returned {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #dc2626 !important;
}

.task-delivery-meta {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin: 4px 0 6px !important;
}

.tdm-chip {
  display: inline-flex !important;
  align-items: center !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  background: var(--ui-surface-soft, #f1f5f9) !important;
  border: 1px solid var(--ui-border, #e2e8f0) !important;
  color: var(--ui-text, #334155) !important;
}

.tdm-chip.tdm-actual {
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #059669 !important;
}

html[data-theme='dark'] .tdm-chip.tdm-actual {
  color: #6ee7b7 !important;
}

/* ==========================================================================
   中国法定节假日（休/班）、传统节日、二十四节气与农历展示样式
   ========================================================================== */
.calendar-day .day-number {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 4px !important;
  min-width: 0 !important;
}

.calendar-day .day-number-left {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.cn-holiday-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 4px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
  user-select: none !important;
}

.cn-holiday-badge.is-rest {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.28) !important;
}

.cn-holiday-badge.is-work {
  background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(51, 65, 85, 0.24) !important;
}

html[data-theme='dark'] .cn-holiday-badge.is-work {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
}

.cn-day-sub {
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  user-select: none !important;
}

.cn-day-sub.is-lunar {
  color: var(--ui-muted, #94a3b8) !important;
  font-weight: 500 !important;
}

.cn-day-sub.is-lunar-month {
  color: var(--ui-accent, #2563eb) !important;
  font-weight: 700 !important;
}

.cn-day-sub.is-festival {
  color: #dc2626 !important;
  font-weight: 700 !important;
  background: rgba(239, 68, 68, 0.1) !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
}

.cn-day-sub.is-term {
  color: #059669 !important;
  font-weight: 700 !important;
  background: rgba(16, 185, 129, 0.1) !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
}

.cn-day-sub.is-work {
  color: #475569 !important;
  font-weight: 700 !important;
}

html[data-theme='dark'] .cn-day-sub.is-festival {
  color: #fca5a5 !important;
  background: rgba(239, 68, 68, 0.2) !important;
}

html[data-theme='dark'] .cn-day-sub.is-term {
  color: #6ee7b7 !important;
  background: rgba(16, 185, 129, 0.18) !important;
}

html[data-theme='dark'] .cn-day-sub.is-work {
  color: #cbd5e1 !important;
}

/* 法定休假日历格温和底色与数字点缀 */
.calendar-day.is-cn-rest:not(.today) .day-number-text {
  color: #dc2626 !important;
}

html[data-theme='dark'] .calendar-day.is-cn-rest:not(.today) .day-number-text {
  color: #f87171 !important;
}

.calendar-day.other-month .cn-holiday-badge,
.calendar-day.other-month .cn-day-sub {
  opacity: 0.52 !important;
}

/* 多月紧凑视图(>4个月)及移动端自动精简副标题防挤压 */
.month-calendar.small .cn-day-sub.is-lunar {
  display: none !important;
}

@media (max-width: 768px) {
  .calendar-day .day-number-left {
    justify-content: center !important;
    gap: 2px !important;
  }
  .calendar-day .cn-day-sub {
    display: none !important;
  }
  .calendar-day .cn-holiday-badge {
    width: 13px !important;
    height: 13px !important;
    font-size: 8px !important;
  }
}

/* ==========================================================================
   功能面板 (#functionsModal) 现代化重构：统一卡片网格、开关磁贴与紧凑操作栏
   ========================================================================== */
#functionsModal .modal-content {
  width: min(840px, 94vw) !important;
  max-width: 840px !important;
  border-radius: 16px !important;
}

/* 顶部已有右上角关闭按钮，隐藏底部冗余空栏释放纵向空间 */
#functionsModal > .modal-content > .modal-footer {
  display: none !important;
}

#functionsModal .modal-header {
  padding: 14px 20px !important;
}

#functionsModal .modal-title {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
}

#functionsModal .modal-title i {
  color: var(--ui-accent, #2563eb) !important;
  font-size: 0.96rem !important;
}

#functionsModal .modal-body {
  padding: 14px 20px 20px !important;
}

#functionsModal .tabs {
  margin-bottom: 14px !important;
  padding: 4px !important;
  border-radius: 11px !important;
  background: var(--ui-surface-soft, #f1f5f9) !important;
  border: 1px solid var(--ui-border, #e2e8f0) !important;
}

#functionsModal .form-group {
  margin-bottom: 12px !important;
}

#functionsModal .form-group > label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: var(--ui-text-muted, #475569) !important;
  margin-bottom: 6px !important;
}

#functionsModal .form-group > label i {
  color: var(--ui-accent, #2563eb) !important;
  font-size: 0.78rem !important;
}

/* 1. 任务发布：三列元数据卡 + 紧凑接收人面板 + 底部双栏操作条 */
#functionsModal .fn-publish-meta-grid {
  grid-template-columns: 1fr 1fr 1.15fr !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
  padding: 10px 14px !important;
  border-radius: 11px !important;
}

#functionsModal .task-assignee-panel {
  padding: 10px 12px !important;
  border-radius: 11px !important;
  background: var(--ui-surface-soft, #f8fafc) !important;
  border: 1px solid var(--ui-border, #e2e8f0) !important;
}

#functionsModal .task-assignee-toolbar {
  margin-bottom: 8px !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid var(--ui-border, #e2e8f0) !important;
}

#functionsModal #taskDescription {
  min-height: 78px !important;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  font-size: 0.88rem !important;
  line-height: 1.55 !important;
  resize: vertical !important;
}

.fn-action-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-top: 14px !important;
  padding-top: 12px !important;
  border-top: 1px solid var(--ui-border, #e2e8f0) !important;
  flex-wrap: wrap !important;
}

.fn-inline-note {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 0.8rem !important;
  color: var(--ui-text-muted, #64748b) !important;
  flex: 1 1 240px !important;
}

.fn-inline-note i {
  color: var(--ui-accent, #2563eb) !important;
}

.fn-primary-cta {
  min-width: 148px !important;
  height: 38px !important;
  padding: 0 20px !important;
  border-radius: 9px !important;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  margin-left: auto !important;
}

/* 2. 提醒设置：双列选择器卡片 + 双列交互开关磁贴 */
.fn-settings-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
}

.fn-field-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  background: var(--ui-surface-soft, #f8fafc) !important;
  border: 1px solid var(--ui-border, #e2e8f0) !important;
}

.fn-field-card > label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  color: var(--ui-text, #0f172a) !important;
}

.fn-field-card > label i {
  color: var(--ui-accent, #2563eb) !important;
  font-size: 0.8rem !important;
}

.fn-field-card .form-control,
.fn-field-card .form-select {
  height: 36px !important;
  padding: 0 10px !important;
  border-radius: 8px !important;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  background: var(--ui-surface, #ffffff) !important;
}

.fn-field-hint {
  font-size: 0.74rem !important;
  color: var(--ui-text-muted, #64748b) !important;
  line-height: 1.35 !important;
}

.fn-switch-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
}

.fn-switch-card {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 13px 15px !important;
  border-radius: 12px !important;
  background: var(--ui-surface-soft, #f8fafc) !important;
  border: 1.5px solid var(--ui-border, #e2e8f0) !important;
  cursor: pointer !important;
  user-select: none !important;
  margin: 0 !important;
  transition: all 0.16s ease !important;
}

.fn-switch-card:hover {
  border-color: rgba(37, 99, 235, 0.4) !important;
  background: var(--ui-surface-hover, #f1f5f9) !important;
}

.fn-switch-card:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.55) !important;
  background: rgba(37, 99, 235, 0.05) !important;
}

.fn-switch-icon {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  background: rgba(37, 99, 235, 0.1) !important;
  color: var(--ui-accent, #2563eb) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.95rem !important;
  flex-shrink: 0 !important;
}

.fn-switch-card:has(input:checked) .fn-switch-icon {
  background: var(--ui-accent, #2563eb) !important;
  color: #ffffff !important;
}

.fn-switch-info {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.fn-switch-info strong {
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  color: var(--ui-text, #0f172a) !important;
  line-height: 1.3 !important;
}

.fn-switch-info span {
  font-size: 0.75rem !important;
  color: var(--ui-text-muted, #64748b) !important;
  line-height: 1.35 !important;
}

.fn-switch-card input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  accent-color: var(--ui-accent, #2563eb) !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  margin: 0 !important;
}

.fn-notice-card {
  margin: 0 !important;
  padding: 10px 14px !important;
  border-radius: 10px !important;
  background: var(--ui-surface-soft, #f8fafc) !important;
  border: 1px dashed var(--ui-border-strong, #cbd5e1) !important;
}

.fn-notice-items {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px 20px !important;
  font-size: 0.78rem !important;
  color: var(--ui-text-muted, #64748b) !important;
}

.fn-notice-items span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.fn-notice-items i {
  color: #10b981 !important;
}

/* 3. 数据管理：5列 KPI 指标横幅 + 现代化卡片分区 */
.fn-stats-banner {
  margin: 0 0 12px 0 !important;
  padding: 10px 12px !important;
  border-radius: 12px !important;
}

.fn-stats-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.fn-stat-item {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 3px !important;
  padding: 8px 10px !important;
  border-radius: 9px !important;
  background: var(--ui-surface, #ffffff) !important;
  border: 1px solid var(--ui-border, #e2e8f0) !important;
  min-width: 0 !important;
}

.fn-stat-label {
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  color: var(--ui-text-muted, #64748b) !important;
}

.fn-stat-value {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  color: var(--ui-text, #0f172a) !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.fn-stat-item.is-success .fn-stat-value {
  color: #10b981 !important;
}

.fn-stat-item.is-warning .fn-stat-value {
  color: #f59e0b !important;
}

.fn-stat-value.fn-stat-text {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
}

#functionsModal .excel-export-panel,
#functionsModal .fn-section-card {
  margin: 0 0 12px 0 !important;
  padding: 14px 16px !important;
  border-radius: 12px !important;
  background: var(--ui-surface-soft, #f8fafc) !important;
  border: 1px solid var(--ui-border, #e2e8f0) !important;
}

#functionsModal .fn-section-card:last-child {
  margin-bottom: 0 !important;
}

.fn-card-head {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-bottom: 10px !important;
}

.fn-card-head h4 {
  margin: 0 0 3px 0 !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  color: var(--ui-text, #0f172a) !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.fn-card-head h4 i {
  color: var(--ui-accent, #2563eb) !important;
}

.fn-card-head p {
  margin: 0 !important;
  font-size: 0.78rem !important;
  color: var(--ui-text-muted, #64748b) !important;
  line-height: 1.4 !important;
}

.fn-picker-quick {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}

.fn-right-actions {
  display: flex !important;
  justify-content: flex-end !important;
  margin-top: 10px !important;
}

#functionsModal .data-management-buttons {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin: 0 !important;
}

#functionsModal .data-management-buttons .btn {
  height: 36px !important;
  font-size: 0.82rem !important;
  border-radius: 8px !important;
}

/* 4. 人员管理：双列紧凑成员卡片网格 */
#functionsModal #userManagementList.fn-user-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)) !important;
  gap: 10px !important;
  max-height: 62vh !important;
  overflow-y: auto !important;
  padding-right: 4px !important;
}

#functionsModal .user-management-item {
  margin: 0 !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  background: var(--ui-surface-soft, #f8fafc) !important;
  border: 1px solid var(--ui-border, #e2e8f0) !important;
  border-left: 3px solid var(--ui-accent, #2563eb) !important;
  box-shadow: none !important;
}

#functionsModal .user-management-header {
  margin-bottom: 8px !important;
}

#functionsModal .user-management-meta {
  gap: 4px 10px !important;
  font-size: 0.75rem !important;
}

#functionsModal .user-edit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin: 8px 0 10px !important;
}

#functionsModal .user-edit-grid label span {
  font-size: 0.73rem !important;
  font-weight: 600 !important;
  color: var(--ui-text-muted, #64748b) !important;
}

#functionsModal .user-edit-grid :is(select, input) {
  height: 32px !important;
  padding: 0 8px !important;
  font-size: 0.8rem !important;
  border-radius: 7px !important;
}

/* 5. 运维监控：紧凑头部横幅 */
#functionsModal .fn-ops-bar {
  padding: 12px 14px !important;
  border-radius: 12px !important;
  background: var(--ui-surface-soft, #f8fafc) !important;
  border: 1px solid var(--ui-border, #e2e8f0) !important;
  margin-bottom: 12px !important;
}

#functionsModal .fn-ops-bar h3 {
  margin: 0 0 3px 0 !important;
  font-size: 0.92rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

#functionsModal .fn-ops-bar p {
  margin: 0 !important;
  font-size: 0.78rem !important;
}

/* 深色模式适配 */
html[data-theme='dark'] #functionsModal .tabs {
  background: #0f172a !important;
  border-color: #23354d !important;
}

html[data-theme='dark'] #functionsModal :is(.task-assignee-panel, .fn-field-card, .fn-switch-card, .fn-notice-card, .excel-export-panel, .fn-section-card, .user-management-item, .fn-ops-bar) {
  background: #111a27 !important;
  border-color: #23354d !important;
}

html[data-theme='dark'] #functionsModal .fn-switch-card:has(input:checked) {
  background: rgba(37, 99, 235, 0.14) !important;
  border-color: #3b82f6 !important;
}

html[data-theme='dark'] #functionsModal .fn-stat-item {
  background: #151f2c !important;
  border-color: #23354d !important;
}

/* 移动端响应式单列回退 */
@media (max-width: 768px) {
  #functionsModal .fn-publish-meta-grid,
  .fn-settings-grid,
  .fn-switch-grid,
  #functionsModal #userManagementList.fn-user-grid {
    grid-template-columns: 1fr !important;
  }
  .fn-stats-grid,
  #functionsModal .data-management-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

