/*
 * Copyright (c) 2026 石进忠. All rights reserved.
 * 我的小待办个人待办管理系统 V1.0
 */

/* 珊瑚橙暖色系主题：奶油背景 + 大圆角卡片 + 柔和阴影 */

:root {
  --bg: #fdf6ee;
  --card: #ffffff;
  --primary: #f08a5d;
  --primary-strong: #ff7e6b;
  --primary-soft: #ffe3d6;
  --green-soft: #dcecc9;
  --yellow-soft: #fdeec9;
  --text: #4a3728;
  --text-light: #9b8a7a;
  --danger: #e85d5d;
  --radius: 16px;
  --shadow: 0 4px 14px rgba(180, 120, 80, 0.12);
  --vh: 1vh;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 文档级横向溢出裁剪：横滑入场动画的位移元素不再撑宽页面，
   避免手机端页面被整体横推、固定顶栏随之错位；
   clip 不产生滚动容器，不影响纵向滚动与 fixed 顶栏 */
html, body {
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: calc(var(--vh, 1vh) * 100);
}
@supports (height: 100dvh) {
  body { min-height: 100dvh; }
}

.hidden { display: none !important; }

.view {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* ---------- 按钮 ---------- */

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  font-size: 15px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  color: #fff;
  padding: 12px 24px;
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--primary-soft);
  color: var(--text);
  padding: 12px 24px;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  padding: 12px 24px;
}

.btn-danger-outline {
  background: transparent;
  border: 2px solid var(--danger);
  color: var(--danger);
  padding: 10px 24px;
}

.btn-text {
  background: transparent;
  color: var(--text-light);
  padding: 10px;
}

.btn-block { display: block; width: 100%; }

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  color: #fff;
  font-size: 16px;
  display: flex;align-items:center;justify-content:center;flex-wrap:wrap;
  box-shadow: var(--shadow);
}
.icon-btn img{width: 12px; height: 12px; display: block;}

/* ---------- 登录 / 改密 ---------- */

.login-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 60px;
  min-height: calc(var(--vh, 1vh) * 100);
}
@supports (height: 100dvh) {
  .login-view { min-height: 100dvh; }
}

.login-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  color: #fff;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.login-title {
  margin: 16px 0 20px;
  font-size: 26px;
}

.welcome-card {
  width: 100%;
  max-width: 380px;
  height: 60px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #ffd9c4, var(--primary-soft));
  display: flex;
  align-items: center;
  padding: 0 24px;
  margin-bottom: 18px;
}

.welcome-text {
  font-size: 20px;
  font-weight: 600;
  border-bottom: 2px solid var(--primary);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-footer {
  margin-top: 10px;
  color: var(--text-light);
  font-size: 13px;
}

/* 忘记密码页：两种方式卡片间距与分组标签 */
#view-recovery .login-card + .login-card { margin-top: 16px; }
.recovery-label { display: block; }

input, textarea, select {
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  border: 1.5px solid #eee0d3;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fffaf5;
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
}

/* ---------- 主视图 ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.app-title { font-size: 24px; }

.tabs {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.tab {
  flex: 0 0 auto;
  padding: 6px 12px;
  background: var(--yellow-soft);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.tab[data-status="active"] { background: var(--primary-soft); }
.tab[data-status="completed"] { background: var(--green-soft); }

.tab.active {
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  color: #fff;
  box-shadow: var(--shadow);
}

/* ---------- 吸顶双行顶栏（sticky 留在文档流内，内容永不被遮挡） ---------- */

.main-view {
  padding-top: constant(safe-area-inset-top);padding-top: env(safe-area-inset-top);
  /* 横滑切换分类的触摸区至少占满整屏：无条目分类下也有足够滑动空间 */
  min-height: calc(var(--vh, 1vh) * 100);
  touch-action: pan-y;
  /* 列表入场动画的横向位移在本视图内裁剪，不外溢撑宽页面；
     clip 不产生滚动容器，不影响纵向滚动与内部 fixed 顶栏 */
  overflow-x: hidden;
  overflow-x: clip;
}
@supports (height: 100dvh) {
  .main-view { min-height: 100dvh; }
}
.app-header {
  position: fixed;left: 50%;transform: translateX(-50%);width: 100%;
  /*position: sticky;width: calc(100% + 32px);margin-left: -16px;*/
  top: 0;
  z-index: 30;
  padding-top: constant(safe-area-inset-top);padding-top: env(safe-area-inset-top);
  background: var(--bg);
  border-bottom: 1px solid #f0e2d4;
  

}
.app-header-space{padding-top: 92px;}
@media (min-width:992px){
  .app-header-space{padding-top: 108px;}
  .app-header{
    max-width: 760px;
  }
}

.header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  /* 内容左右到边：不限宽居中，仅留两侧内边距 */
  padding: 10px 16px 8px;
}

.header-row .app-title {
  font-size: 17px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.icon-btn-sm {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--text);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn-sm img{width: 16px;height: 16px;display: block;}

.icon-btn-sm.on {
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  color: #fff;
}

/* ---------- 优先级条（右侧固定） ---------- */

.priority-strip {
  position: fixed;
  right: calc(50vw - 392px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 35;
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(180, 120, 80, 0.15);
  backdrop-filter: blur(8px);
}

.pri-card {
  flex: 0 0 auto;
  padding: 8px 6px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.2;
  color: var(--text);
  white-space: nowrap;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 2px;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  min-width: 32px;
  text-align: center;
}

.pri-card.selected {
  font-weight: 600;
}

/* 收缩态：仅显示 emoji */
.priority-strip.collapsed .pri-card {
  padding: 6px;
  min-width: 32px;
  font-size: 16px;
  letter-spacing: 0;
}

/* 展开态：显示竖排文字 */
.priority-strip:not(.collapsed) .pri-card {
  padding: 10px 8px;
  min-width: 36px;
}

.pri-toggle {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--text-light);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  margin-top: 4px;
  transition: transform 0.3s ease;
}

.pri-toggle:hover {
  background: var(--primary);
  color: #fff;
}

/* 展开态按钮旋转 180 度 */
.priority-strip:not(.collapsed) .pri-toggle {
  transform: rotate(180deg);
}

/* 条目卡片中的优先级色点 */
.pri-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* 弹层内优先级选择器 */
.pri-select {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.pri-option {
  flex: 1 1 calc(50% - 3px);
  min-width: 0;
  padding: 8px 6px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  transition: all 0.15s;
}

.pri-option.selected {
  font-weight: 600;
}

.app-header .category-swiper {
  margin: 0 0 6px;
  padding: 2px 16px 6px;
}

/* 悬浮添加按钮（右下角固定） */
.fab {
  position: fixed;
  right: 20px;
  bottom: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  color: #fff;
  font-size: 28px;
  box-shadow: 0 6px 18px rgba(240, 138, 93, 0.5);
  z-index: 40;
  display: flex;align-items:center;justify-content:center;flex-wrap:wrap;
}
.fab img { width: 24px; height: 24px; display: block; }

/* 清空搜索悬浮按钮：位于添加/清空按钮正上方，蓝灰色区分功能 */
.fab-search {
  bottom: 96px;
  background: linear-gradient(135deg, #5b8dbf, #7fa8cf);
  font-size: 15px;
  box-shadow: 0 6px 18px rgba(91, 141, 191, 0.5);
}

/* PC 宽屏：悬浮按钮对齐内容区右边缘（内容区 760px 居中 + 16px 内边距），而非整个视口右下角 */
@media (min-width: 792px) {
  .fab {
    right: calc(50% - 364px);
  }
}

/* ---------- 搜索面板（顶部固定展开） ---------- */

.search-panel {
  position: fixed;
  top: 0;
  /* 与页面内容区同宽居中（内容区 .view 最大 760px） */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 760px;
  box-sizing: border-box;
  z-index: 60;
  background: var(--card);
  box-shadow: 0 8px 20px rgba(180, 120, 80, 0.28);
  border-radius: 0 0 16px 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-panel input,
.search-panel select {
  max-width: 728px;
}

.search-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(74, 55, 40, 0.28);
  z-index: 55;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-search { flex: 1; min-width: 0; }

.filter-scope {
  flex: 1;
  min-width: 0;
}

.filter-date {
  flex: 1;
  min-width: 0;
  padding: 10px;
  font-size: 14px;
}

.filter-sep {
  flex: 0 0 auto;
  color: var(--text-light);
  font-size: 14px;
}

.filter-clear {
  flex: 0 0 auto;
  padding: 10px 14px;
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .header-row { padding: 8px 12px 6px; gap: 6px; }
  .header-row .app-title { font-size: 15px; }
  .filter-scope { font-size: 13px; padding: 10px 6px; }
  .filter-date { font-size: 13px; padding: 9px 6px; }
  /* 小屏优先级条收缩为更紧凑的布局 */
  .priority-strip { right: 6px; padding: 6px 4px; gap: 4px; }
  .pri-card { font-size: 11px; padding: 6px 4px; }
  .priority-strip.collapsed .pri-card { min-width: 28px; font-size: 14px; }
  .priority-strip:not(.collapsed) .pri-card { min-width: 30px; padding: 8px 6px; }
  .pri-option { flex: 1 1 calc(50% - 3px); font-size: 11px; padding: 6px 4px; }
}

/* 类别卡片横向滚动：由 Swiper 驱动触摸滑动，卡片间距由 Swiper spaceBetween 控制 */
.category-swiper {
  width: 100%;
  padding: 4px 2px 10px;
}

.category-strip {
  display: flex;
}

/* 卡片作为 Swiper 滑块：宽度随内容自适应 */
.category-strip .swiper-slide {
  width: auto;
  height: auto;
}

/* Swiper 加载失败时的降级：退回原生横向滚动 */
.category-strip.no-swiper {
  gap: 1px;
  overflow-x: auto;
}

.cat-card {
  flex: 0 0 auto;
  min-width: 80px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
  color: var(--text);
}

.cat-card .cat-count {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.cat-card .cat-name {
  display: block;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}

.cat-card.selected {
  box-shadow: 0 0 0 1.5px var(--primary), var(--shadow);
  color: var(--text);
}

.cat-card.selected .cat-name { color: var(--text); }

.cat-new {
  background: transparent;
  border: 2px dashed var(--primary);
  color: var(--primary);
  box-shadow: none;
  font-weight: 600;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* 吸顶顶栏与首张卡片之间的额外间距 */
  margin-top: 12px;
}

/* 横滑切换分类：列表方向感知入场动画，与滑动方向呼应 */
@keyframes cat-slide-in-right {
  from { opacity: 0.3; transform: translateX(48px); }
  to { opacity: 1; transform: none; }
}
@keyframes cat-slide-in-left {
  from { opacity: 0.3; transform: translateX(-48px); }
  to { opacity: 1; transform: none; }
}
.todo-list.swipe-in-right { animation: cat-slide-in-right 0.22s ease-out; }
.todo-list.swipe-in-left { animation: cat-slide-in-left 0.22s ease-out; }
/* 系统开启减弱动态效果时关闭动画 */
@media (prefers-reduced-motion: reduce) {
  .todo-list.swipe-in-right,
  .todo-list.swipe-in-left { animation: none; }
}

.todo-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.todo-card.done .todo-title {
  text-decoration: line-through;
  color: var(--text-light);
}

.todo-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.todo-check {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: var(--primary);
  transform: scale(1.15);
  cursor: pointer;
}

.todo-body { flex: 1; min-width: 0; }

.todo-title {
  font-size: 16px;
  font-weight: 600;
  word-break: break-all;
}

.todo-note {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
  word-break: break-all;
  /* 保留备注中的换行符：单个换行显示为换行，连续多个换行显示为空行 */
  white-space: pre-wrap;
}

.todo-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
}

/* 截止日期标签：默认柔和黄，今日橙，逾期红 */
.todo-due {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: #8a6d1f;
}

.todo-due.due-today {
  background: #ffdfc4;
  color: #c2571b;
  font-weight: 600;
}

.todo-due.due-overdue {
  background: #fddcdc;
  color: var(--danger);
  font-weight: 600;
}

/* 分类排序按钮（上移/下移，双端通用） */
.cat-manage-item button.move {
  padding: 8px 10px;
  min-width: 38px;
  min-height: 36px;
  font-weight: 700;
}

.cat-manage-item button.move:disabled {
  opacity: 0.35;
  cursor: default;
}

.cat-manage-tip {
  font-size: 12px;
  color: var(--text-light);
}

.todo-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.todo-actions button {
  flex: 1;
  padding: 10px 0;
  background: #f7ece1;
  color: var(--text);
}

.todo-actions .act-delete {
  background: #f9f9f9;
}
.todo-actions .act-complete, .todo-actions .act-back {
  flex: 2;

  background: var(--primary);
  color: #fff;
}

.empty-tip {
  text-align: center;
  color: var(--text-light);
  margin-top: 40px;
}

/* ---------- 设置页 ---------- */

.section-label {
  font-size: 15px;
  color: var(--text-light);
  margin: 18px 0 8px;
}

.card-block {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.card-block .uc-flex{
  display: flex;align-items:center;justify-content:center;flex-wrap:wrap;
}
.card-block button{flex:1;min-width: 0;margin-left: 10px;}
.card-block button:first-child{margin-left: 0px;}

.field-label { font-size: 14px; font-weight: 600; min-width: 4em;; }
.field-label .e2{margin-right: 2em;font-style: normal;}
.field-label .e05{margin-right: .5em;font-style: normal;}
.field-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: -6px;
  margin-left: 64px;
}

.tip-text {
  color: var(--text-light);
  font-size: 13px;
  margin: 18px 4px 10px;
}

.tip-inline {
  color: var(--text-light);
  font-size: 12px;
  line-height: 1.5;
}

/* 设置页底部「关于」入口：跳转功能介绍页 */
.about-link {
  display: block;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  margin-top: 24px;
  text-decoration: none;
}

.about-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* 关于页 */
.about-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.about-hero {
  text-align: center;
  padding: 28px 0 20px;
}

.about-hero .app-title {
  font-size: 26px;
}

.about-hero .about-version {
  color: var(--text-light);
  font-size: 13px;
  margin-top: 6px;
}

.about-back {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 14px;
  text-decoration: none;
}

.about-block + .about-block { margin-top: 14px; }

.about-block {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-top: 14px;
}

.about-block h2 {
  font-size: 16px;
  margin-bottom: 8px;
}

.about-block p,
.about-block li {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}

.about-block ul {
  padding-left: 20px;
}

.about-copyright {
  text-align: center;
  color: var(--text-light);
  font-size: 12px;
  margin-top: 26px;
  line-height: 1.8;
}

/* 使用教程页：分组标题 + 问答折叠卡片 */
.tutorial-link + .about-link {
  margin-top: 8px;
}

.tutorial-group {
  font-size: 14px;
  color: var(--text-light);
  margin: 22px 2px 2px;
}

.qa-item {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 10px;
  overflow: hidden;
}

.qa-item summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.qa-item summary::-webkit-details-marker { display: none; }

/* 问题前的 Q 徽标 */
.qa-item summary::before {
  content: "问";
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 展开箭头 */
.qa-item summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--text-light);
  font-size: 13px;
  transition: transform 0.2s ease;
}

.qa-item[open] summary::after {
  transform: rotate(180deg);
}

.qa-answer {
  padding: 12px 18px 14px 48px;
  border-top: 1px dashed var(--primary-soft);
}

.qa-answer p,
.qa-answer li {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}

.qa-answer p + p {
  margin-top: 8px;
}

.qa-answer ul {
  padding-left: 20px;
  margin: 4px 0;
}

/* 退出登录与其它区块的间距保持一致（同 section-label 的 18px） */
#btn-logout {
  margin-top: 18px;
}

/* ---------- 弹层 ---------- */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(74, 55, 40, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-small { max-width: 320px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 17px;
}

.modal-close {
  background: var(--primary-strong);
  width: 32px;
  height: 32px;
  color: var(--text);
  display: flex;align-items:center;justify-content:center;flex-wrap:wrap;
}
.modal-close img{width: 12px;height: 12px;display: block;}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 弹层行内输入框/文本域占满剩余宽度（如标题、备注 + 语音按钮组合） */
.field-row input,
.field-row textarea { flex: 1; min-width: 0; }

/* 语音输入按钮：默认浅色，录音中红色脉冲提示 */
.voice-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-soft);
  font-size: 18px;
  line-height: 1;
  display: flex;align-items:center;justify-content:center;flex-wrap:wrap;
}
.voice-btn img{
  width: 20px;
  height: 20px;
  display: block;
}

.voice-btn.recording {
  background: #e85d5d;
  animation: voice-pulse 1.2s ease-in-out infinite;
}

@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 93, 93, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(232, 93, 93, 0); }
}

.field-row .field-label { flex: 0 0 auto; }

.confirm-text { font-size: 15px; line-height: 1.6; }

.move-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.move-option {
  background: #f7ece1;
  padding: 12px 16px;
  text-align: left;
  color: var(--text);
}

.move-option.current {
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 700;
}

.category-manage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.cat-manage-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fdf3e9;
  border-radius: 12px;
  padding: 8px 12px;
}

.cat-manage-item .cat-name-text { flex: 1; font-size: 14px; }

.cat-manage-item button {
  padding: 8px 12px;
  font-size: 13px;
  background: var(--primary-soft);
  color: var(--text);
  min-height: 36px;
}

.cat-manage-item button.danger {
  background: var(--primary);
  color: #fff;
}

/* ---------- 轻提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 60px;
  transform: translateX(-50%);
  background: rgba(74, 55, 40, 0.92);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 99;
  max-width: 80vw;
}

/* ---------- 自定义日期选择器 ---------- */

.date-picker-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.date-display {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1.5px solid #eee0d3;
  border-radius: 12px;
  background: #fffaf5;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  user-select: none;
  transition: border-color 0.2s;
}

.date-display:hover { border-color: var(--primary); }
.date-display.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.date-display.placeholder { color: var(--text-light); }

.date-display .date-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  background: var(--primary-soft);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--primary);
  font-weight: 700;
}

.date-display .date-text { flex: 1; min-width: 0; }

.date-display .date-clear {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}

.date-display:hover .date-clear { opacity: 1; }

.date-popup {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 70;
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(180, 120, 80, 0.22);
  padding: 14px;
  width: 280px;
  display: none;
}

.date-popup.open { display: block; }

.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.dp-month {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: none;
  padding: 2px 6px;
  border-radius: 6px;
}

.dp-header button {
  background: var(--primary-soft);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.dp-today-btn {
  font-size: 12px !important;
  width: auto !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  font-weight: 600;
}

.dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
  font-weight: 600;
}

.dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.dp-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  background: none;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

.dp-day:hover { background: var(--primary-soft); }
.dp-day.other-month { color: #d4c4b4; }
.dp-day.today { font-weight: 700; color: var(--primary); }
.dp-day.selected { background: linear-gradient(135deg, var(--primary-strong), var(--primary)); color: #fff; font-weight: 600; }

@media (max-width: 600px) {
  .date-popup { width: 260px; }
}

/* ---------- 自定义下拉选择 ---------- */

.cs-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border: 1.5px solid #eee0d3;
  border-radius: 12px;
  background: #fffaf5;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  user-select: none;
  transition: border-color 0.2s;
}

.cs-trigger:hover { border-color: var(--primary); }
.cs-wrap.open .cs-trigger { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }

.cs-arrow {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-light);
  transition: transform 0.2s;
}

.cs-wrap.open .cs-arrow { transform: rotate(180deg); }

.cs-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 70;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(180, 120, 80, 0.2);
  padding: 4px;
  display: none;
  max-height: 200px;
  overflow-y: auto;
}

.cs-wrap.open .cs-options { display: block; }

.cs-option {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
}

.cs-option:hover { background: var(--primary-soft); }
.cs-option.selected { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ---------- 响应式 ---------- */

/* 移动端隐藏自定义语音按钮，使用手机输入法自带语音即可 */
@media (max-width: 768px) {
  .voice-btn { display: none !important; }
}

@media (max-width: 600px) {
  .view { padding: 14px 12px 60px; }
  .app-title { font-size: 21px; }
  .tab { font-size: 14px; }
  .todo-actions button { font-size: 14px; padding: 12px 0; }
}
