/* ===================== 柳比歇夫时间管理模块 ===================== */

.lyubi-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

/* ---- 头部 ---- */
.lyubi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
}
.lyubi-header-left {
  flex: 1;
}
.lyubi-header h1 {
  font-size: 26px;
  color: #1f2937;
  margin: 0 0 4px 0;
}
.lyubi-icon {
  margin-right: 6px;
}
.lyubi-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}
.lyubi-header-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  padding-top: 2px;
}
@media (max-width: 640px) {
  .lyubi-header {
    flex-direction: column;
    align-items: stretch;
  }
  .lyubi-header-actions {
    flex-direction: column;
  }
  .lyubi-header-actions .lyubi-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ---- 统计卡片 ---- */
.lyubi-stats {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.lyubi-stat-card {
  flex: 1;
  min-width: 190px;
  background: var(--color-white);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 2px 8px var(--color-primary-shadow), 0 1px 2px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: default;
  text-align: center;
}
.lyubi-stat-card:hover {
  box-shadow: 0 6px 20px var(--color-primary-shadow), 0 2px 4px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}
/* 四张统计卡数值颜色统一用项目主色 */
.lyubi-stat-card:nth-child(1) .lyubi-stat-value,
.lyubi-stat-card:nth-child(2) .lyubi-stat-value,
.lyubi-stat-card:nth-child(3) .lyubi-stat-value,
.lyubi-stat-card:nth-child(4) .lyubi-stat-value { color: #FF589B; }

.lyubi-stat-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.4px;
  position: relative;
  z-index: 1;
}
.lyubi-stat-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 2px;
  position: relative;
  z-index: 1;
}
.lyubi-stat-sub {
  font-size: 12px;
  color: var(--color-text-hint);
  margin-left: 4px;
  position: relative;
  z-index: 1;
}
/* 上月/去年报告满意度卡：允许下拉列表溢出卡片边界显示 */
.lm-sat-card,
.ly-sat-card {
  overflow: visible;
}
.lm-sat-card .lyubi-custom-select,
.ly-sat-card .lyubi-custom-select {
  z-index: 10;
}
/* 上月报告统计区：4 列布局（合计/平均/天数/满意度 各占 1 列），与上方统计行对齐 */
.report-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-left: -24px;
  margin-right: -24px;
}
/* 满意度下拉列表：更小字号、不加粗 */
.lm-sat-card .lyubi-custom-select-options,
.ly-sat-card .lyubi-custom-select-options {
  margin-top: 0;   /* 与输入框间隙为 0 */
}
.lm-sat-card .lyubi-custom-select-options li,
.ly-sat-card .lyubi-custom-select-options li {
  font-size: 12px;
  font-weight: 400;
}
.lm-sat-card .lyubi-custom-select-options li.selected,
.ly-sat-card .lyubi-custom-select-options li.selected {
  font-weight: 400;
}
/* 满意度选中值：字号适中、颜色平滑过渡 */
.lm-sat-card .lyubi-custom-select-trigger,
.ly-sat-card .lyubi-custom-select-trigger {
  font-size: 14px;
}
.lm-sat-card .lyubi-custom-select-value,
.ly-sat-card .lyubi-custom-select-value {
  transition: color 0.15s ease;
}
/* 上月/去年报告明细表：行高更大一些 */
#lmBreakdownRow td,
#lyBreakdownRow td {
  padding: 12px 10px;
  line-height: 1.6;
}
@media (max-width: 640px) {
  .lyubi-stat-card {
    min-width: 100%;
  }
}

/* ---- 按钮栏 ---- */
.lyubi-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.lyubi-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}
.lyubi-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.25s ease;
}
.lyubi-btn:hover::after {
  background: rgba(255,255,255,0.12);
}
.lyubi-btn:active {
  transform: scale(0.97);
}
.lyubi-btn-primary {
  background: #64748b;
  color: #fff;
  box-shadow: 0 2px 8px rgba(100, 116, 139, 0.3);
}
.lyubi-btn-primary:hover {
  background: #475569;
  box-shadow: 0 4px 14px rgba(100, 116, 139, 0.4);
  transform: translateY(-1px);
}
.lyubi-btn-secondary {
  background: #64748b;
  color: #fff;
  box-shadow: 0 2px 8px rgba(100, 116, 139, 0.3);
}
.lyubi-btn-secondary:hover {
  background: #475569;
  box-shadow: 0 4px 14px rgba(100, 116, 139, 0.4);
  transform: translateY(-1px);
}
.lyubi-btn-success {
  background: #FF589B;
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 88, 155, 0.3);
}
.lyubi-btn-success:hover {
  background: #e84d8a;
  box-shadow: 0 4px 14px rgba(255, 88, 155, 0.4);
  transform: translateY(-1px);
}
.lyubi-btn-outline {
  background: #f8f9fa;
  color: #495057;
  border: 1.5px solid #dee2e6;
}
.lyubi-btn-outline:hover {
  background: #e9ecef;
  border-color: #ced4da;
  transform: translateY(-1px);
}
.lyubi-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ---- 卡片 ---- */
.lyubi-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.lyubi-card-title {
  font-size: 18px;
  color: #1f2937;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}

/* ---- 自定义满意度下拉框 ---- */
.lyubi-custom-select {
  position: relative;
  cursor: pointer;
  user-select: none;
}
.lyubi-custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  color: #1f2937;
  transition: border-color 0.2s;
}
.lyubi-custom-select:hover .lyubi-custom-select-trigger {
  border-color: #9ca3af;
}
.lyubi-custom-select-arrow {
  font-size: 12px;
  color: #9ca3af;
  transition: transform 0.2s;
}
.lyubi-custom-select:hover .lyubi-custom-select-arrow {
  transform: rotate(180deg);
}
.lyubi-custom-select-options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0 0 0 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  z-index: 100;
  overflow: hidden;
}
.lyubi-custom-select:hover .lyubi-custom-select-options {
  display: block;
}
.lyubi-custom-select-options li {
  padding: 8px 12px;
  font-size: 14px;
  color: #1f2937;
  cursor: pointer;
  transition: background 0.15s;
}
.lyubi-custom-select-options li:hover {
  background: #f3f4f6;
}
.lyubi-custom-select-options li.selected {
  color: #FF589B;
  font-weight: 600;
  background: #FFF5F8;
}

/* ---- 自定义日期选择器 ---- */
.lyubi-custom-datepicker {
  position: relative;
  cursor: pointer;
  user-select: none;
}
.lyubi-custom-datepicker-trigger {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.2s;
}
.lyubi-custom-datepicker:hover .lyubi-custom-datepicker-trigger {
  border-color: #9ca3af;
}
.lyubi-custom-datepicker-trigger input {
  flex: 1;
  border: none !important;
  outline: none !important;
  padding: 0 !important;
  font-size: 14px;
  font-family: inherit;
  color: #1f2937;
  background: transparent;
  cursor: pointer;
}
.lyubi-custom-datepicker-icon {
  font-size: 16px;
  margin-left: 6px;
  line-height: 1;
}
.lyubi-custom-datepicker-dropdown {
  display: none;
  position: absolute;
  top: calc(100% - 4px);
  left: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  z-index: 200;
  padding: 12px;
  width: 260px;
}
.lyubi-custom-datepicker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.lyubi-date-nav {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
  color: #374151;
  transition: background 0.15s;
}
.lyubi-date-nav:hover {
  background: #f3f4f6;
}
.lyubi-date-title {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}
.lyubi-date-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}
.lyubi-date-table th {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
  padding: 4px 0;
}
.lyubi-date-table td {
  font-size: 13px;
  color: #374151;
  padding: 5px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  width: 14.28%;
}
.lyubi-date-table td:hover {
  background: #f3f4f6;
}
.lyubi-date-table td.lyubi-date-today {
  font-weight: 700;
  color: #FF589B;
}
.lyubi-date-table td.lyubi-date-selected {
  background: #FF589B;
  color: #fff;
  font-weight: 600;
}
.lyubi-date-table td.lyubi-date-other {
  color: #d1d5db;
}

/* ---- 表单 ---- */
.lyubi-form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.lyubi-form-row .lyubi-form-group {
  flex: 1;
  min-width: 180px;
}
.lyubi-form-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.lyubi-form-grid .lyubi-form-group {
  flex: 1;
  min-width: 0;
}
.lyubi-form-group {
  display: flex;
  flex-direction: column;
}
.lyubi-form-group label {
  font-size: 13px;
  color: #374151;
  margin-bottom: 4px;
  font-weight: 500;
}
.lyubi-form-group input,
.lyubi-form-group select {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #1f2937;
  background: #fff;
  transition: border-color 0.2s;
}
.lyubi-form-group input:hover,
.lyubi-form-group select:hover {
  border-color: #9ca3af;
}
.lyubi-form-group input:focus,
.lyubi-form-group select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
  outline: none;
}
.lyubi-form-group input[type="number"] {
  -moz-appearance: textfield;
}
.lyubi-form-group input[type="number"]::-webkit-inner-spin-button,
.lyubi-form-group input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.lyubi-form-submit-row {
  text-align: center;
  margin-top: 18px;
}

/* ---- 双图表并排行 ---- */
.lyubi-chart-row {
  display: flex;
  gap: 20px;
}
.lyubi-chart-col {
  flex: 1;
  min-width: 0;
}
.lyubi-chart-col .lyubi-chart-wrapper {
  min-height: 300px;
}
@media (max-width: 900px) {
  .lyubi-chart-row {
    flex-direction: column;
  }
}

/* ---- 图表 ---- */
.lyubi-chart-desc {
  font-size: 13px;
  color: #9ca3af;
  margin: -8px 0 12px 0;
}
.lyubi-chart-wrapper {
  position: relative;
  width: 100%;
  min-height: 380px;
}
.lyubi-chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: #f9fafb;
  border-radius: 8px;
  color: #9ca3af;
  font-size: 15px;
}

/* ---- 自定义模态框 ---- */
.lyubi-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lyubi-modal-box {
  background: #fff;
  border-radius: 14px;
  width: 400px;
  max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.lyubi-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px 0;
}
.lyubi-modal-icon {
  font-size: 22px;
}
.lyubi-modal-header h3 {
  font-size: 18px;
  color: #1f2937;
  margin: 0;
}
.lyubi-modal-body {
  padding: 12px 20px 18px;
  font-size: 15px;
  color: #4b5563;
  line-height: 1.5;
  overflow: visible;
}
/* 弹窗正文文本水平居中（列表类弹窗用表格，不受 text-align 影响） */
.lyubi-modal-body #lyubiModalMessage {
  text-align: center;
}
.lyubi-modal-footer {
  padding: 0 24px 20px;
  display: flex;
  justify-content: center;
}
.lyubi-modal-footer .lyubi-btn {
  min-width: 100px;
  padding: 10px 32px;
  font-size: 14px;
  border-radius: 10px;
}

/* ---- 响应式 ---- */
@media (max-width: 640px) {
  .lyubi-container {
    padding: 16px 12px 40px;
  }
  .lyubi-header h1 {
    font-size: 22px;
  }
  .lyubi-form-grid {
    flex-wrap: wrap;
  }
  .lyubi-form-grid .lyubi-form-group {
    flex: 0 0 calc(50% - 6px);
    min-width: 0;
  }
  .lyubi-actions {
    flex-direction: column;
  }
  .lyubi-actions .lyubi-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ---- 多行学习记录表 ---- */
.lyubi-table-wrap {
  overflow-x: auto;
  margin: 12px 0;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}
.lyubi-session-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 820px;
}
.lyubi-session-table thead th {
  background: #f7f8fa;
  color: #374151;
  font-weight: 600;
  font-size: 12px;
  padding: 10px 6px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid #e5e7eb;
  border-right: 1px solid #e8e8e8;
}

.lyubi-session-table tbody td {
  padding: 0;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
  border-right: 1px solid #f0f0f0;
  vertical-align: middle;
}

.lyubi-session-table tbody tr:last-child td {
  border-bottom: none;
}
/* 行条纹：偶数列白，奇数列极浅灰 */
.lyubi-session-table tbody tr:nth-child(even) td {
  background: #f7f8fa;
}
.lyubi-session-table tbody tr:nth-child(even) td:hover input[type="number"],
.lyubi-session-table tbody tr:nth-child(odd) td:hover input[type="number"] {
  background: #fff;
}
.lyubi-session-table tbody tr:hover {
  background: transparent;
}
.lyubi-session-table input[type="number"] {
  width: 100%;
  height: 36px;
  padding: 0 4px;
  border: none;
  border-radius: 0;
  font-size: 13px;
  font-family: inherit;
  color: #1f2937;
  background: transparent;
  text-align: center;
  transition: background 0.15s;
  -moz-appearance: textfield;
  box-sizing: border-box;
  outline: none;
  display: block;
}
.lyubi-session-table input[type="number"]::-webkit-inner-spin-button,
.lyubi-session-table input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.lyubi-session-table tbody td:hover input[type="number"] {
  background: #fff;
}
.lyubi-session-table input[type="number"]:focus {
  background: #fff;
  box-shadow: inset 0 0 0 1.5px #3b82f6;
}
.th-action {
  width: 50px;
  min-width: 50px;
}
.th-row-num {
  width: 50px;
  min-width: 50px;
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 400 !important;
}
.lyubi-row-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #d1d5db;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}
.lyubi-row-del:hover {
  background: #fee2e2;
  color: #ef4444;
}
.lyubi-row-del.lyubi-row-del-hidden {
  visibility: hidden;
}
/* 合计行 */
.lyubi-session-total td {
  font-weight: 700;
  color: #1f2937;
  font-size: 13px;
  padding: 10px 6px;
  text-align: center;
  border-top: 2px solid #e5e7eb;
  border-right: 1px solid #e8e8e8;
  background: #f7f8fa;
}
.lyubi-session-total td span {
  display: block;
  text-align: center;
}

.lyubi-session-total .td-row-num {
  width: 50px;
  min-width: 50px;
  color: #6b7280;
  font-size: 12px;
  text-align: center;
}
/* 底部操作栏 */
.lyubi-table-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.lyubi-btn-add {
  background: #fff;
  color: #64748b;
  border: 1.5px dashed #cbd5e1;
  border-radius: 10px;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
  letter-spacing: 0.3px;
}
.lyubi-btn-add:hover {
  background: #f8fafc;
  border-color: #64748b;
  transform: translateY(-1px);
}
.lyubi-btn-add:active {
  transform: scale(0.97);
}

/* ---- 建议录入日期提示 ---- */
.lyubi-suggest-text {
  font-size: 13px;
  color: #94a3b8;
  white-space: nowrap;
}
.lyubi-suggest-text strong {
  color: #FF589B;
  font-weight: 600;
}
@media (max-width: 1024px) {
  .lyubi-suggest-text {
    font-size: 12px;
  }
}

/* ---- 时间管理面板：移动端（桌面端不受影响） ---- */
@media (max-width: 767px) {
  /* 添加每日记录 表头：标题/提示 与 四个操作按钮 换行铺满（类名或结构选择器双保险） */
  #panel-time .lyubi-panel-head,
  #panel-time .lyubi-card:first-of-type > div:first-child {
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
  }
  #panel-time .lyubi-panel-head > div:first-child,
  #panel-time .lyubi-card:first-of-type > div:first-child > div:first-child {
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }
  #panel-time .lyubi-panel-actions,
  #panel-time .lyubi-card:first-of-type > div:first-child > div:last-child {
    flex-wrap: wrap;
    width: 100%;
  }
  #panel-time .lyubi-panel-actions .lyubi-btn,
  #panel-time .lyubi-card:first-of-type > div:first-child > div:last-child .lyubi-btn {
    flex: 1 1 auto;
    padding: 10px 12px;
    font-size: 13px;
    justify-content: center;
    text-align: center;
  }
  #panel-time .lyubi-suggest-text {
    white-space: normal;
  }
  #panel-time .lyubi-session-table input[type="number"] {
    height: 40px;
  }
  #panel-time .lyubi-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #panel-time .lyubi-session-table {
    min-width: 760px;
  }
  #panel-time .lyubi-table-actions .lyubi-btn {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
    padding: 12px 14px;
    font-size: 13px;
  }
  #panel-time .lyubi-card > .lyubi-chart-row {
    flex-direction: column;
  }
}
