/* style.css (在原有代码最后追加以下内容) */
/* ================= 1. 全局变量与基础 ================= */
:root {
  --primary: #2e7d32;
  --primary-light: #f1f7f2;
  --secondary: #1976d2;
  --bg: #f4f7f6;
  --card-bg: #ffffff;
  --text-main: #333333;
  --text-muted: #666666;
  --border: #e0e0e0;
  --danger: #d32f2f;
  --warning: #ed6c02;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  margin: 0;
  padding: 20px;
  line-height: 1.6;
}

.container {
  max-width: 950px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 30px;
  font-size: 28px;
}

/* ================= 2. 卡片与折叠系统 ================= */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 24px;
  margin-bottom: 24px;
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.card-header-flex .card-title {
  border-bottom: none;
  margin: 0;
  padding: 0;
  font-size: 18px;
  font-weight: bold;
  color: var(--secondary);
}

.toggle-icon {
  font-size: 14px;
  color: #999;
  transition: transform 0.3s;
  font-weight: bold;
}

.card-collapsed .card-content {
  display: none !important;
}

/* 折叠时，三角形转为向上 */
.card-collapsed .toggle-icon {
  transform: rotate(180deg);
}

.card-collapsed .card-header-flex {
  border-bottom: none;
  margin: 0;
  padding: 0;
}

/* ================= 3. 表单与输入框 ================= */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--text-main);
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.input-addon {
  color: var(--text-muted);
  font-weight: bold;
}

/* 常规输入框剥离苹果默认样式，保持 40px 等高 */
select,
input[type="number"],
input[type="text"] {
  height: 40px !important;
  padding: 0 10px !important;
  border: 1px solid var(--border);
  border-radius: 8px !important;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
  background-color: #fff;
  font-family: inherit;
  color: var(--text-main);
}

/* 种下时间专属：保留苹果原生唤醒能力，不加 -webkit-appearance:none */
input[type="datetime-local"] {
  height: 40px !important;
  padding: 0 10px !important;
  border: 1px solid var(--border);
  border-radius: 8px !important;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  background-color: #fff;
  font-family: inherit;
  color: var(--text-main);
}

.input-row input {
  flex: 1;
}

/* ================= 4. 按钮系统 ================= */
.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.time-btn {
  flex: 1;
  min-width: 60px;
  padding: 10px 0;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.2s;
}

.time-btn.active {
  background: var(--primary);
  color: white;
}

/* 同步、保存、Now 等主要操作按钮 */
.sync-btn,
.now-btn {
  height: 40px !important;
  padding: 0 15px !important;
  margin: 0;
  background: var(--primary) !important;
  color: #fff !important;
  font-weight: bold;
  cursor: pointer;
  border: none !important;
  border-radius: 8px !important;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;

  /* 🌟 优化 1：防止文字被意外选中。网页版快速连点时，很容易变成“选中文字”的蓝色底色，加上这个彻底避免 */
  user-select: none;
  -webkit-user-select: none;

  /* 🌟 优化 2：把 0.2s 改成 0.05s ease-out。0.2s 显得肉肉的，0.05s 会带来极其干脆的“机械键盘”回弹感 */
  transition: all 0.05s ease-out;
}

/* 鼠标/手指按下的反馈状态 */
.sync-btn:active,
.now-btn:active {
  /* 🌟 优化 3：把 0.95 改为 0.92。因为过渡时间变短了，缩放幅度稍微加大一点，视觉上的“敲击感”会更强 */
  transform: scale(0.92);
  opacity: 0.85;
}

/* 温柔的日历小按钮 */
.alarm-btn {
  margin-top: 8px !important;
  padding: 6px 0 !important;
  font-size: 11px !important;
  font-weight: bold;
  color: var(--primary) !important;
  background: var(--primary-light) !important;
  border: none !important;
  border-radius: 6px !important;
  cursor: pointer;
  transition: 0.2s;
  width: 100% !important;
  height: auto !important;
  letter-spacing: -0.5px;
  display: block !important;
}

.alarm-btn:hover {
  background: #c8e6c9 !important;
}

.alarm-btn-danger {
  color: var(--danger) !important;
  background: #ffebee !important;
}

.alarm-btn-danger:hover {
  background: #ffcdd2 !important;
}

/* ================= 5. 数据中心表格与排期器 ================= */
#resultPanel {
  display: none;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
  font-size: 16px;
}

.alert-danger {
  background-color: #ffebee;
  color: var(--danger);
  border: 1px solid #ffcdd2;
}

.alert-warning {
  background-color: #fff3e0;
  color: var(--warning);
  border: 1px solid #ffe0b2;
}

.alert-success {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid #c8e6c9;
}

.alarm-time {
  font-size: 28px;
  font-weight: bold;
  display: block;
  margin: 12px 0;
}

.timeline-container {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 5px;
  scrollbar-width: none;
}

.timeline-container::-webkit-scrollbar {
  display: none;
}

.timeline-card {
  flex: 1;
  min-width: 0;
  background: #fafafa;
  border-radius: 8px;
  padding: 10px 4px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

th:hover {
  background-color: #c8e6c9;
}

.row-hover:hover {
  background-color: #f9f9f9;
}

.highlight-data {
  font-weight: bold;
  color: var(--danger);
}

.pmo-warning {
  color: #999;
}

.pmo-star {
  font-weight: bold;
  color: var(--primary);
  background-color: #fff8e1;
}

.pmo-crown {
  font-weight: bold;
  color: #d84315;
  background-color: #ffcc80;
}

.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 15px;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: bold;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom: 3px solid var(--primary);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= 6. 账号管家 - 极致紧凑兼容 ================= */
.account-manager-card {
  padding: 16px 10px !important;
}

.ios-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-reset {
  background: #fff;
  color: #d32f2f;
  border: 1px solid #ff4d4f;
}

.btn-add {
  background: #2e7d32;
  color: #fff;
}

.account-table {
  width: 100% !important;
  min-width: 100% !important;
}

/* 移除死板的 11 列设定，把控制权交还给 Vue 的动态引擎 */
.acc-tr {
  display: grid !important;
  align-items: center;
  border-bottom: 1px solid #f2f2f2;
  min-height: 40px;
  /* 加上这行，让展开/收起时有一个平滑像手风琴一样的过渡动画 */
  transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.acc-td {
  padding: 4px 1px !important;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* 基础内部输入框 */
.acc-td input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 11px !important;
  padding: 0 !important;
  color: #333;
  outline: none;
  -webkit-appearance: none;
  box-sizing: border-box;
}












/* ================= 🌟 状态满格变色（完美对齐版） ================= */

/* 1. 强制名字和祝福所在的单元格“上下拉满”，填满整行高度 */
.acc-td.name-td,
.acc-td.w-bless {
  align-self: stretch !important; /* 核心：强制拉伸填满高度 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0 !important;      /* 去除自带的上下留白 */
  padding-bottom: 0 !important;
  margin: 0 !important;
}

/* 2. 名字满格变灰 */
.name-completed .name-td {
  background-color: #b4b4b4 !important;
}

/* 3. 名字输入框：完全透明化，不撑开额外的留白 */
.name-completed .name-input {
  background-color: transparent !important;
  color: #555 !important;
  height: 100% !important;
  width: 100% !important;
  border: none !important;
  outline: none !important;
  margin: 0;
  box-sizing: border-box;
}

/* 4. 祝福值为 0 时，变黑 */
.bless-empty-bg {
  background-color: #222222 !important;
  transition: background-color 0.2s ease;
}
.bless-empty-bg div, 
.bless-empty-bg input {
  color: #777777 !important;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 作物变黄保留 */
.has-fruit {
  background-color: #fffac0 !important;
}




/* 任务复选框 */
.custom-cb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #c7c7cc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: 0.2s;
}

.custom-cb.checked {
  background: #07c160;
  border-color: #07c160;
  color: #fff;
}

/* ================= 7. 完美的统一正方形操作按钮 ================= */
.icon-btn {
  background: #f4f5f9;
  border: none;
  border-radius: 6px;
  width: 28px !important;
  height: 28px !important;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  color: #666;
  transition: 0.2s;
}

.icon-btn:active {
  background: #e0e0e0;
  transform: scale(0.95);
}

.icon-btn-danger {
  color: #ff4d4f;
  background: #fff1f0;
}

.icon-btn-danger:active {
  background: #ffcdd2;
}

.sort-btn-group {
  display: flex;
  flex-direction: column;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  background: #f4f5f9;
}

.sort-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: #666;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.sort-btn:active {
  background: #dcdcdc;
}

.sort-btn:first-child {
  border-bottom: 1px solid #fff;
}

/* ================= 8. 终极时间选择器：透明层 ================= */
.time-display {
  width: 100%;
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  color: #07c160;
  pointer-events: none;
  /* 让点击穿透 */
  /* 👇 核心修复：严禁长按时选中这行绿色的文字 */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  /* 禁用苹果的长按放大镜和菜单 */
}

.time-display.danger {
  color: #ff4d4f !important;
  background: rgba(255, 77, 79, 0.1) !important;
  border-radius: 4px;
}

@keyframes dangerPulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }

  100% {
    opacity: 1;
  }
}

/* 透明的原生输入框铺满全格 */
input[type="time"].acc-time-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
  margin: 0;
  padding: 0;
  border: none;
}

/* ================= 神仙思路：全透明清空覆盖层 ================= */
.invisible-clear-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  cursor: pointer;
  /* 👇 核心修复：严禁长按透明层时触发系统文本选择 */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  /* 顺手干掉安卓机点击时自带的灰色方块闪烁 */
}

/* 悬浮清空小叉号 */
.clear-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: rgba(0, 0, 0, 0.15);
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  cursor: pointer;
  z-index: 10;
  font-weight: bold;
}

.clear-badge:active {
  background-color: #ff4d4f;
}



/* 🌟 2. 保证网格过渡平滑 */
.acc-tr {
  display: grid;
  align-items: center;
  border-bottom: 1px solid #f2f2f2;
  min-height: 40px;
  transition: grid-template-columns 0.3s ease; /* 伸缩动画 */
}

/* 🌟 3. Vue 渲染防闪烁 */
[v-cloak] {
  display: none !important;
}

/* ================= 9. 手机端精准缩放适配 ================= */
@media screen and (max-width: 768px) {
  body {
    padding: 8px;
  }

  .card {
    padding: 16px;
    margin-bottom: 16px;
  }

  h1 {
    font-size: 22px;
    margin-bottom: 20px;
  }

  .card-title,
  .card-header-flex .card-title {
    font-size: 16px;
  }

  .time-btn {
    font-size: 13px;
    padding: 8px 0;
  }

  table {
    font-size: 12px;
  }

  th,
  td {
    padding: 8px 6px;
  }

  .card > div[style*="font-size: 48px"] {
    font-size: 36px !important;
    padding: 8px !important;
  }

  .card > div > h3 {
    font-size: 18px !important;
  }

  /* 针对超小屏幕的管家微调 */
  .acc-td input {
    font-size: 10px !important;
  }

  .time-display {
    font-size: 11px !important;
  }

  /* 手机上按钮等比缩小为 24x24px */
  .icon-btn,
  .sort-btn-group {
    width: 24px !important;
    height: 24px !important;
  }

  .icon-btn {
    font-size: 12px;
  }
}


/* ================= 🌟 Vue 重构专属样式 ================= */
/* 防止 Vue 还没加载完时页面闪烁 {{ }} 乱码 */
[v-cloak] { display: none !important; }



/* 让精简模式切换时，表格列宽平滑过渡，不生硬 */
.acc-tr {
  transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}



/* ================= 10. 底部 TabBar 与伪独立页系统 ================= */
/* 给底部腾出空间，防止内容被导航栏遮挡，并适配 iPhone 底部小黑条 */
body {
  padding-bottom: calc(70px + env(safe-area-inset-bottom)) !important;
}

/* 分页容器默认隐藏，带有淡入动画 */
.page-section {
  display: none;
  animation: pageFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.page-section.active {
  display: block;
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 底部 TabBar 主体 */
.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  /* 🌟 核心修改：让它和顶部主体内容一样限制最大宽度并完美居中 */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 950px; /* 和 .container 的 max-width 保持绝对一致 */
  
  height: 60px;
  background: var(--primary);
  backdrop-filter: blur(10px); /* 磨砂玻璃效果 */
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  z-index: 9999;
  padding-bottom: env(safe-area-inset-bottom); /* 适配刘海屏 */
  border-top: 1px solid #f0f0f0;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #999;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tab-item.active {
  color: var(--primary-light); /* 选中时变成绿色 */
}

.tab-icon {
  font-size: 22px;
  margin-bottom: 2px;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: grayscale(100%) opacity(0.6); /* 默认变灰暗 */
}

.tab-item.active .tab-icon {
  transform: scale(1.15); /* 选中时图标微微放大 */
  filter: grayscale(0%) opacity(1); /* 选中时恢复彩色 */
}

.tab-text {
  font-size: 11px;
  font-weight: bold;
}



/* ================= 🌟 小程序原生风格开关 ================= */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.ios-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 20px;
}
.ios-switch .slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.ios-switch input:checked + .slider {
  background-color: var(--primary); /* 开启时变绿 */
}
.ios-switch input:checked + .slider:before {
  transform: translateX(16px);
}



/* ================= 🌟 终极打磨：全网页底层背景换色 ================= */

body {

  /* 🌟 如果你希望背景色完全跟随主题色的极淡版本 */
background-color: var(--primary-light); 
}




/* 💡 为了让效果更好看，建议给 container 加一点点顶部间距，不至于让文字顶着屏幕边缘 */
.container {
  padding-top: 10px;
  padding-bottom: 80px; /* 为底部 TabBar 留出足够空间 */
}


/* ================= 🌟 高级排期器与时间轴专属样式 ================= */
.dnw-card {
  margin-top: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.dnw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #f4f5f9;
}
.dnw-panel {
  padding: 12px 15px;
  border-top: 1px solid var(--border);
}

/* 垂直时间轴 UI */
.tl-node {
  position: relative;
  margin-bottom: 18px;
}
.tl-node:last-child {
  margin-bottom: 0;
}
.tl-node::before {
  content: '';
  position: absolute;
  left: -22px; /* 完美对齐竖线 */
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fafafa;
}
.tl-node.danger::before { background: var(--danger); }
.tl-node.warning::before { background: var(--warning); }

.tl-time { font-size: 13px; color: #888; font-weight: bold; margin-right: 10px; font-family: monospace;}
.tl-title { font-size: 14px; font-weight: bold; color: var(--text-main); }
.tl-desc { 
  font-size: 12px; 
  color: var(--text-muted); 
  margin-top: 6px; 
  line-height: 1.5; 
  background: #fff; 
  padding: 8px 10px; 
  border-radius: 6px;
  border: 1px solid var(--border);
}



.status-red { 
  color: #ff4d4f !important; 
  background: rgba(255, 77, 79, 0.1); 
  font-weight: bold;
  border-radius: 4px;
}
.status-blue { 
  color: #1976d2 !important; 
  background: rgba(25, 118, 210, 0.05); 
  font-weight: bold;
  border-radius: 4px;
}


/* ================= 🌟 修复长按清空时间时光标乱跑 ================= */
/* 1. 彻底禁止表格整行的长按文字选中机制 */
.acc-tr {
  -webkit-user-select: none !important;
  user-select: none !important;
}

/* 2. 特赦：只允许正儿八经的输入框可以被选中打字，其它一律不准选 */
.acc-td input[type="text"],
.acc-td input[type="number"],
.name-input {
  -webkit-user-select: text !important;
  user-select: text !important;
}
