:root {
	  --bg: #f5f0e8;
	  --paper: #faf7f2;
	  --cell: #fefcf7;
	  --border: #d8ccb8;
	  --past: #f0ece4;
	  --pastBd: #ddd4c4;
	  --today: #fff8ec;
	  --todayBd: #e8b878;
	  --txt: #4a3728;
	  --txtL: #8b7d6b;
	  --txtM: #b0a090;
	  --accent: #d4956b;
	  --glow: rgba(220, 160, 80, 0.4);
	}
	* {
	  margin: 0;
	  padding: 0;
	  box-sizing: border-box;
	}
	body {
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  background: var(--bg);
	  overflow: hidden;
	  width: 100vw;
	  height: 100vh;
	  -webkit-user-select: none;
	  user-select: none;
	}
	body.rtl {
	  direction: rtl;
	}
	/* 电脑端语言选择器样式 */
	.lang-sel {
	  position: fixed;
	  top: 14px;
	  left: 14px;
	  z-index: 500;
	  padding: 7px 28px 7px 10px;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: .78rem;
	  border: 2px solid #d4c4a8;
	  border-radius: 12px 6px;
	  background: #fefcf8;
	  color: var(--txt);
	  cursor: pointer;
	  appearance: none;
	  -webkit-appearance: none;
	  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23876b50' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
	  background-repeat: no-repeat;
	  background-position: right 8px center;
	  outline: none;
	  transition: border-color .2s;
	  box-shadow: 2px 2px 0 rgba(150, 120, 80, .15);
	}
	.lang-sel:hover {
	  border-color: var(--accent);
	}
	body.rtl .lang-sel {
	  left: auto;
	  right: 14px;
	  background-position: left 8px center;
	  padding: 7px 10px 7px 28px;
	}
	.input-page {
	  position: fixed;
	  inset: 0;
	  z-index: 200;
	  display: flex;
	  align-items: center;
	  justify-content: center;
	  padding: 20px;
	  overflow-y: auto;
	  transition: opacity .8s, filter .8s;
	  background: var(--bg);
	}
	.input-page.hidden {
	  opacity: 0;
	  filter: blur(8px);
	  pointer-events: none;
	}
	#bgCanvas {
	  position: fixed;
	  inset: 0;
	  z-index: 0;
	  pointer-events: none;
	}
	.input-card {
	  position: relative;
	  z-index: 1;
	  background: #fefcf8;
	  border-radius: 20px 10px;
	  padding: 36px 30px 28px;
	  max-width: 440px;
	  width: 100%;
	  border: 3px solid #d4c4a8;
	  box-shadow: 8px 8px 0 rgba(150, 120, 80, .2), 0 4px 24px rgba(0, 0, 0, .08);
	  text-align: center;
	  animation: cardIn .6s ease-out;
	  flex-shrink: 0;
	}
	@keyframes cardIn {
	  from {
	    opacity: 0;
	    transform: translateY(24px);
	    filter: blur(4px);
	  }
	  to {
	    opacity: 1;
	    transform: none;
	    filter: none;
	  }
	}
	.input-card h1 {
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: 2.2rem;
	  color: var(--txt);
	  margin-bottom: 4px;
	  letter-spacing: .03em;
	}
	.input-card p {
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: 1rem;
	  color: var(--txtL);
	  margin-bottom: 20px;
	}
	.input-card label {
	  display: block;
	  text-align: left;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: 1.1rem;
	  color: var(--txtL);
	  margin: 10px 0 4px 4px;
	}
	body.rtl .input-card label {
	  text-align: right;
	}
	.input-card input,
	.input-card select {
	  display: block;
	  width: 100%;
	  padding: 12px 16px;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: 1.1rem;
	  color: var(--txt);
	  background: #fefcf8;
	  border: 2px solid #d4c4a8;
	  border-radius: 12px 6px;
	  outline: none;
	  transition: border-color .2s;
	  -webkit-appearance: none;
	  appearance: none;
	}
	.input-card select {
	  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23876b50' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
	  background-repeat: no-repeat;
	  background-position: right 10px center;
	  padding-right: 30px;
	}
	.input-card input:focus,
	.input-card select:focus {
	  border-color: #c4956b;
	}
	.life-row {
	  display: flex;
	  align-items: center;
	  gap: 8px;
	  flex-wrap: wrap;
	}
	.life-row input,
	.life-row select {
	  width: 100px;
	  flex-shrink: 0;
	}
	.date-row {
	  gap: 6px;
	}
	.date-row select {
	  width: auto;
	  flex: 1;
	  min-width: 0;
	}
	.life-row span {
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  color: var(--txt);
	  font-size: 1.1rem;
	}
	.age-hint {
	  font-size: .78rem;
	  min-height: 1.4em;
	  color: #c0785a;
	  flex-basis: 100%;
	  margin-top: 2px;
	  transition: opacity .3s;
	}
	body.rtl .age-hint {
	  direction: rtl;
	}
	.btn-go {
	  display: inline-block;
	  margin-top: 22px;
	  padding: 14px 36px;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: 1.2rem;
	  color: #5c3020;
	  background: #fce8d5;
	  border: 2.5px solid var(--accent);
	  border-radius: 25px 12px;
	  cursor: pointer;
	  font-weight: 700;
	  box-shadow: 4px 4px 0 rgba(180, 120, 70, .3);
	  transition: all .25s;
	  letter-spacing: .04em;
	}
	.btn-go:hover {
	  background: #fffaf4;
	  border-color: #c47d4e;
	  transform: translateY(-2px);
	  box-shadow: 6px 6px 0 rgba(180, 120, 70, .35);
	}
	#calCanvas,
	#bgCanvas {
	  position: fixed;
	  inset: 0;
	  z-index: 1;
	  cursor: grab;
	  -webkit-transform: translateZ(0);
	  transform: translateZ(0);
	  image-rendering: crisp-edges;
	  image-rendering: -webkit-optimize-contrast;
	}
	#bgCanvas {
	  z-index: 0;
	  pointer-events: none;
	}
	#calCanvas.grabbing {
	  cursor: grabbing;
	}
	.zoom-hint {
	  position: fixed;
	  top: 60px;
	  left: 50%;
	  transform: translateX(-50%);
	  z-index: 150;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: 1.05rem;
	  color: rgba(74, 55, 40, .3);
	  pointer-events: none;
	  transition: opacity 2s;
	  letter-spacing: 2px;
	  white-space: nowrap;
	  background: rgba(254, 252, 247, .6);
	  padding: 8px 20px;
	  border-radius: 20px;
	  backdrop-filter: blur(4px);
	}
	.zoom-hint.hidden {
	  opacity: 0;
	}
	.controls {
	  position: fixed;
	  bottom: 20px;
	  left: 50%;
	  transform: translateX(-50%);
	  z-index: 100;
	  display: none;
	  align-items: center;
	  gap: 8px;
	  background: rgba(254, 252, 247, .92);
	  backdrop-filter: blur(10px);
	  padding: 8px 16px;
	  border-radius: 24px;
	  border: 2px solid #d4c4a8;
	  box-shadow: 0 4px 16px rgba(80, 50, 30, .1);
	}
	.controls.active {
	  display: flex;
	}
	.ctrl-btn {
	  padding: 6px 14px;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: 1rem;
	  background: #fefcf8;
	  border: 2px solid #d4c4a8;
	  border-radius: 14px 7px;
	  cursor: pointer;
	  color: var(--txt);
	  transition: all .2s;
	  white-space: nowrap;
	  font-weight: 700;
	}
	.ctrl-btn:hover {
	  border-color: #c4956b;
	  transform: translateY(-1px);
	}
	.ctrl-btn.accent {
	  background: #fce8d5;
	  border-color: var(--accent);
	  font-weight: 700;
	}
	.modal-overlay {
	  position: fixed;
	  inset: 0;
	  background: rgba(40, 25, 10, .55);
	  z-index: 300;
	  display: none;
	  align-items: center;
	  justify-content: center;
	}
	.modal-overlay.active {
	  display: flex;
	}
	.modal-box {
	  background: #fdf8f0;
	  border-radius: 16px 8px;
	  padding: 24px;
	  max-width: 440px;
	  width: 90%;
	  border: 3px solid #d4c4a8;
	  box-shadow: 8px 8px 0 rgba(100, 60, 20, 0.3);
	  position: relative;
	  max-height: 80vh;
	  overflow-y: auto;
	  animation: modalIn .3s ease-out;
	}
	.modal-box::-webkit-scrollbar {
	  width: 4px;
	}
	.modal-box::-webkit-scrollbar-track {
	  background: #e8dcc8;
	  border-radius: 4px;
	}
	.modal-box::-webkit-scrollbar-thumb {
	  background: #d4956b;
	  border-radius: 4px;
	}
	@keyframes modalIn {
	  from {
	    opacity: 0;
	    transform: scale(.92) translateY(16px);
	  }
	  to {
	    opacity: 1;
	    transform: none;
	  }
	}
	.modal-close {
	  position: absolute;
	  top: 10px;
	  right: 14px;
	  font-size: 1.5rem;
	  cursor: pointer;
	  color: #a09080;
	  background: none;
	  border: none;
	  transition: color .2s;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	}
	body.rtl .modal-close {
	  right: auto;
	  left: 14px;
	}
	.modal-close:hover {
	  color: #5c3020;
	}
	.modal-box input,
	.modal-box select {
	  display: block;
	  width: 100%;
	  margin: 8px 0;
	  padding: 10px 14px;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: .9rem;
	  color: var(--txt);
	  background: #fefcf8;
	  border: 2px solid #d4c4a8;
	  border-radius: 10px 5px;
	  outline: none;
	}
	.modal-box select {
	  appearance: none;
	  -webkit-appearance: none;
	  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23876b50' stroke-width='2' fill='none'/%3E%3C/svg%3E");
	  background-repeat: no-repeat;
	  background-position: right 14px center;
	}
	/* ===== 新建日程弹窗表单样式优化 ===== */
	.form-row {
	  display: flex;
	  align-items: center;
	  gap: 8px;
	  margin: 8px 0;
	  flex-wrap: wrap;
	  justify-content: space-between;
	}
	.form-row label:first-child {
	  width: 70px;
	  font-size: .9rem;
	  color: var(--txtL);
	  flex-shrink: 0;
	  text-align: left;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	}
	body.rtl .form-row label:first-child {
	  text-align: right;
	}
	/* 1. 覆盖 .modal-box input 的 width: 100%，防止同行元素被挤压 */
	.form-row input,
	.form-row select {
	  width: auto;
	}
	/* 2. 通用输入框占满剩余空间 */
	.form-row input:not([type="checkbox"]):not(.date-input):not(.time-input),
	.form-row select:not(.date-input):not(.time-input),
	.form-row .toggle-switch {
	  flex: 1;
	  min-width: 0;
	}
	/* 3. 日期输入框：弹性占满剩余空间，绝对禁止压缩 */
	.form-row .date-input {
	  flex: 1 1 auto;
	  min-width: 130px;
	  width: auto;
	  padding: 10px 8px;
	}
	/* 4. 时间输入框：固定紧凑宽度，绝对禁止压缩 */
	.form-row .time-input {
	  flex: 0 0 100px;
	  min-width: 100px;
	  width: auto;
	  padding: 10px 8px;
	}
	/* 全天开关行 - 特殊处理让开关右对齐 */
	.all-day-row {
	  justify-content: space-between;
	}
	.all-day-row label:first-child {
	  width: auto;
	}
	.all-day-row .toggle-switch {
	  margin-left: auto;
	  flex: 0 0 auto;
	}
	/* 带 textarea 的行 - 顶部对齐 */
	.form-row-textarea {
	  align-items: flex-start;
	}
	.form-row-textarea label:first-child {
	  padding-top: 10px;
	}
	/* textarea 多行输入框样式 */
	.modal-textarea {
	  flex: 1;
	  min-width: 0;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: .9rem;
	  color: var(--txt);
	  background: #fefcf8;
	  border: 2px solid #d4c4a8;
	  border-radius: 10px 5px;
	  outline: none;
	  padding: 10px 14px;
	  resize: vertical;
	  word-wrap: break-word;
	  white-space: pre-wrap;
	  overflow-wrap: break-word;
	  line-height: 1.4;
	}
	/* toggle 开关样式 */
	.toggle-switch {
	  position: relative;
	  display: inline-block;
	  width: 46px;
	  height: 24px;
	  flex-shrink: 0;
	}
	.toggle-switch input {
	  opacity: 0;
	  width: 0;
	  height: 0;
	}
	.toggle-slider {
	  position: absolute;
	  cursor: pointer;
	  inset: 0;
	  background: #e0d4c0;
	  transition: .3s;
	  border-radius: 24px;
	}
	.toggle-slider:before {
	  position: absolute;
	  content: "";
	  height: 18px;
	  width: 18px;
	  left: 3px;
	  bottom: 3px;
	  background: white;
	  transition: .3s;
	  border-radius: 50%;
	}
	input:checked + .toggle-slider {
	  background: var(--accent);
	}
	input:checked + .toggle-slider:before {
	  transform: translateX(22px);
	}
	/* 全天开关开启时圆点靠到最右侧 */
	.all-day-row input:checked + .toggle-slider:before {
	  transform: translateX(22px);
	}
	.btn-row {
	  display: flex;
	  gap: 8px;
	  margin-top: 16px;
	  flex-wrap: wrap;
	  justify-content: center;
	}
	.hand-btn {
	  padding: 10px 22px;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: .9rem;
	  color: var(--txt);
	  background: #fdf8f0;
	  border: 2px solid #c4a882;
	  border-radius: 20px 10px;
	  cursor: pointer;
	  transition: all .2s;
	  box-shadow: 2px 2px 0 rgba(150, 120, 80, .2);
	}
	.hand-btn.primary {
	  background: #fce8d5;
	  border-color: var(--accent);
	  color: #5c3020;
	  font-weight: 700;
	}
	.hand-btn:hover {
	  transform: translateY(-1px);
	  box-shadow: 4px 4px 0 rgba(150, 120, 80, .25);
	}
	.type-tags {
	  display: flex;
	  flex-wrap: wrap;
	  gap: 6px;
	  margin: 10px 0;
	  justify-content: center;
	}
	.type-tag {
	  padding: 5px 12px;
	  border-radius: 14px;
	  font-size: .85rem;
	  cursor: pointer;
	  border: 2px solid transparent;
	  transition: all .2s;
	  display: flex;
	  align-items: center;
	  gap: 4px;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	}
	.type-tag.active {
	  border-color: var(--txt);
	  transform: scale(1.05);
	}
	.type-dot {
	  width: 8px;
	  height: 8px;
	  border-radius: 50%;
	}
	
	/* ===== 侧边栏新样式 ===== */
	.sidebar-overlay {
	  position: fixed;
	  top: 0;
	  right: 0;
	  bottom: 0;
	  width: 360px;
	  background: #faf7f2;
	  border-left: 3px solid #d4c4a8;
	  box-shadow: -4px 0 16px rgba(80, 50, 30, .15);
	  z-index: 250;
	  transform: translateX(100%);
	  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
	  display: flex;
	  flex-direction: column;
	}
	.sidebar-overlay.active {
	  transform: translateX(0);
	}
	body.rtl .sidebar-overlay {
	  right: auto;
	  left: 0;
	  border-left: none;
	  border-right: 3px solid #d4c4a8;
	  transform: translateX(-100%);
	}
	body.rtl .sidebar-overlay.active {
	  transform: translateX(0);
	}
	.sidebar-drag-handle {
	  position: absolute;
	  left: -16px;
	  top: 50%;
	  transform: translateY(-50%);
	  width: 32px;
	  height: 56px;
	  display: flex;
	  align-items: center;
	  justify-content: center;
	  cursor: col-resize;
	  z-index: 10;
	  background: transparent;
	  border: none;
	  outline: none;
	}
	body.rtl .sidebar-drag-handle {
	  left: auto;
	  right: -16px;
	  cursor: col-resize;
	}
	.sidebar-close {
	  position: absolute;
	  top: 12px;
	  right: 14px;
	  font-size: 1.2rem;
	  cursor: pointer;
	  color: #a09080;
	  z-index: 10;
	  transition: color .2s;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	}
	body.rtl .sidebar-close {
	  right: auto;
	  left: 14px;
	}
	.sidebar-close:hover {
	  color: #5c3020;
	}
	.sidebar-header {
	  padding: 20px 16px 10px;
	  text-align: center;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  border-bottom: 1px solid #e8dcc8;
	  flex-shrink: 0;
	}
	.sidebar-header .sb-date {
	  font-size: 2.4rem;
	  color: var(--txt);
	  line-height: 1.1;
	  font-weight: 700;
	}
	.sidebar-header .sb-info {
	  font-size: 1rem;
	  color: #8b7d6b;
	  font-weight: 700;
	}
	
	/* 可调整大小的容器 */
	.resizable-container {
	  flex: 1;
	  display: flex;
	  flex-direction: column;
	  min-height: 0;
	  overflow: hidden;
	}
	
	/* 24小时视图容器 */
	.timeline-container {
	  flex: 1;
	  display: flex;
	  flex-direction: column;
	  min-height: 100px;
	  overflow: hidden;
	}
	
	.sidebar-fixed-part {
	  flex-shrink: 0;
	  background: #faf7f2;
	  z-index: 5;
	  border-bottom: 1px solid #d4c4a8;
	}
	.sidebar-scroll-part {
	  flex: 1;
	  overflow-y: auto;
	  position: relative;
	  background: #f5f0e8;
	}
	
	/* 拖拽分割条 */
	.split-bar {
	  height: 16px;
	  background: #e0d4c0;
	  cursor: row-resize;
	  flex-shrink: 0;
	  position: relative;
	  transition: background 0.2s;
	  touch-action: none;
	  user-select: none;
	  z-index: 10;
	}
	.split-bar:hover {
	  background: #d4956b;
	}
	.split-handle {
	  position: absolute;
	  top: 50%;
	  left: 50%;
	  transform: translate(-50%, -50%);
	  width: 80px;
	  height: 4px;
	  background: #b0a090;
	  border-radius: 2px;
	  pointer-events: none;
	}
	
	/* 待办列表容器 */
	.todo-container {
	  flex: 1;
	  display: flex;
	  flex-direction: column;
	  min-height: 100px;
	  background: #fefcf8;
	  border-top: 2px solid #e8dcc8;
	}
	.todo-header {
	  padding: 12px 16px;
	  background: #faf7f2;
	  border-bottom: 1px solid #e8dcc8;
	  flex-shrink: 0;
	}
	.todo-header h4 {
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: 1rem;
	  color: var(--txt);
	  margin: 0;
	  font-weight: 700;
	  display: flex;
	  align-items: center;
	  gap: 6px;
	}
	
	/* 待办列表滚动区域 */
	.todo-list {
	  flex: 1;
	  overflow-y: auto;
	  padding: 8px 12px;
	}
	
	/* 待办项样式 - 不显示时间 */
	.todo-item {
	  display: flex;
	  align-items: center;
	  gap: 12px;
	  padding: 10px 12px;
	  margin-bottom: 6px;
	  background: #fefcf8;
	  border-radius: 12px 8px;
	  border: 1px solid #e8dcc8;
	  transition: all 0.2s;
	  cursor: pointer;
	}
	.todo-item:hover {
	  background: #fffaf4;
	  border-color: #d4c4a8;
	  transform: translateX(2px);
	}
	
	/* 复选框样式 */
	.todo-checkbox {
	  width: 20px;
	  height: 20px;
	  cursor: pointer;
	  flex-shrink: 0;
	  accent-color: #d4956b;
	}
	
	/* 待办内容 */
	.todo-content {
	  flex: 1;
	  display: flex;
	  align-items: center;
	  gap: 8px;
	}
	
	/* 时间标签 - 隐藏 */
	.todo-time {
	  display: none;
	}
	
	/* 待办标题 */
	.todo-title {
	  font-size: 0.9rem;
	  color: #4a3728;
	  word-break: break-word;
	  flex: 1;
	}
	
	/* 已完成状态 */
	.todo-item.completed {
	  background: #f0ece4;
	  border-color: #ddd4c4;
	  opacity: 0.7;
	}
	.todo-item.completed .todo-title {
	  text-decoration: line-through;
	  color: #b0a090;
	}
	
	/* 待办类型颜色点 */
	.todo-type-dot {
	  width: 8px;
	  height: 8px;
	  border-radius: 50%;
	  flex-shrink: 0;
	}
	
	/* 空状态提示 */
	.todo-empty {
	  text-align: center;
	  padding: 30px 20px;
	  color: #b0a090;
	  font-size: 0.85rem;
	}
	
	/* 侧边栏右拖拽宽度适配 */
	@media(max-width: 600px) {
	  .sidebar-overlay {
	    width: 85vw;
	  }
	}
	
	/* ===== 24小时视图原有样式 ===== */
	.time-grid {
	  position: relative;
	  height: 1440px;
	  background: linear-gradient(to bottom, #faf7f2 0%, #f5f0e8 100%);
	}
	.time-hour-row {
	  height: 60px;
	  border-top: 1px solid rgba(216, 204, 184, .4);
	  position: relative;
	  pointer-events: auto;
	  cursor: pointer;
	}
	.time-hour-label {
	  position: absolute;
	  top: -8px;
	  left: 0;
	  width: 50px;
	  text-align: right;
	  font-size: .8rem;
	  color: #8b7d6b;
	  font-weight: 700;
	  z-index: 1;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  pointer-events: none;
	}
	.time-hour-line {
	  position: absolute;
	  top: 0;
	  left: 60px;
	  right: 0;
	  height: 1px;
	  background: rgba(216, 204, 184, .4);
	  pointer-events: none;
	}
	.all-day-slot {
	  min-height: 40px;
	  padding: 8px 12px;
	}
	.all-day-slot h4 {
	  font-size: 1rem;
	  color: var(--txt);
	  margin-bottom: 6px;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-weight: 700;
	  text-align: center;
	}
	.all-day-event {
	  font-size: .85rem;
	  padding: 4px 8px;
	  border-radius: 4px;
	  margin-bottom: 4px;
	  color: var(--txt);
	  cursor: pointer;
	  transition: transform .1s;
	  display: flex;
	  align-items: center;
	  gap: 4px;
	}
	.all-day-event:hover {
	  transform: translateX(2px);
	}
	.time-event-block {
	  position: absolute;
	  left: 65px;
	  right: 10px;
	  border-radius: 6px;
	  padding: 2px 6px;
	  font-size: .8rem;
	  overflow: hidden;
	  cursor: grab;
	  z-index: 2;
	  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
	  user-select: none;
	  border-left: 4px solid;
	  background-clip: padding-box;
	}
	.time-event-block:hover {
	  z-index: 3;
	  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
	}
	.time-event-block .ev-title {
	  font-weight: 600;
	  white-space: nowrap;
	  overflow: hidden;
	  text-overflow: ellipsis;
	}
	.time-event-block .ev-time {
	  font-size: .7rem;
	  opacity: .8;
	}
	.resize-handle {
	  position: absolute;
	  left: 0;
	  right: 0;
	  height: 6px;
	  cursor: ns-resize;
	  z-index: 4;
	  background: transparent;
	}
	.resize-handle.top {
	  top: 0;
	}
	.resize-handle.bottom {
	  bottom: 0;
	}
	
	/* 信息弹窗样式 */
	#infoPopover {
	  display: none;
	  position: fixed;
	  z-index: 400;
	  background: #fdf8f0;
	  border: 2px solid #d4c4a8;
	  border-radius: 20px 12px;
	  padding: 18px 20px;
	  min-width: 240px;
	  max-width: 320px;
	  box-shadow: 6px 6px 0 rgba(100, 60, 20, 0.25);
	  pointer-events: auto;
	  transition: all 0.2s ease;
	}
	.popover-header {
	  display: flex;
	  justify-content: space-between;
	  align-items: flex-start;
	  gap: 12px;
	  margin-bottom: 14px;
	}
	.popover-title {
	  flex: 1;
	  font-weight: 700;
	  font-size: 1.2rem;
	  color: var(--txt);
	  line-height: 1.35;
	  word-break: break-word;
	  font-family: inherit;
	  text-align: left;
	}
	.popover-actions {
	  display: flex;
	  gap: 10px;
	  align-items: center;
	  flex-shrink: 0;
	}
	.popover-actions span {
	  cursor: pointer;
	  opacity: 0.7;
	  transition: opacity 0.2s, transform 0.1s;
	  font-size: 1rem;
	}
	.popover-actions span:hover {
	  opacity: 1;
	  transform: scale(1.05);
	}
	.popover-time {
	  font-size: 0.85rem;
	  color: #8b7d6b;
	  margin-bottom: 12px;
	  padding-bottom: 10px;
	  border-bottom: 1px solid #e8dcc8;
	  word-break: break-word;
	  line-height: 1.4;
	  text-align: left;
	}
	.popover-location {
	  font-size: 0.85rem;
	  color: #8b7d6b;
	  margin-bottom: 12px;
	  display: flex;
	  align-items: center;
	  justify-content: flex-start;
	  gap: 6px;
	  word-break: break-word;
	  line-height: 1.4;
	}
	.popover-description {
	  font-size: 0.85rem;
	  color: #4a3728;
	  margin-bottom: 12px;
	  padding: 0;
	  line-height: 1.45;
	  word-break: break-word;
	  white-space: pre-wrap;
	  text-align: left;
	  display: block;
	}
	.popover-footer {
	  margin-top: 6px;
	  padding-top: 12px;
	  border-top: 1px solid #e8dcc8;
	  display: flex;
	  justify-content: flex-start;
	}
	.popover-type {
	  display: inline-flex;
	  align-items: center;
	  gap: 8px;
	  font-size: 0.8rem;
	  font-weight: 600;
	  padding: 5px 12px;
	  border-radius: 24px;
	  background: #f5efe6;
	  width: fit-content;
	  color: var(--txtL);
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	}
	
	#ctxMenu {
	  display: none;
	  position: fixed;
	  z-index: 400;
	  background: #fdf8f0;
	  border: 2px solid #d4c4a8;
	  border-radius: 8px;
	  box-shadow: 4px 4px 0 rgba(100, 60, 20, .3);
	  padding: 4px 0;
	  min-width: 120px;
	}
	.ctx-item {
	  padding: 8px 16px;
	  cursor: pointer;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: .95rem;
	  color: var(--txt);
	  transition: background .15s;
	}
	.ctx-item:hover {
	  background: #fce8d5;
	}
	.ctx-item.danger {
	  color: #c06060;
	}
	.confirm-overlay {
	  position: fixed;
	  inset: 0;
	  background: rgba(40, 25, 10, .55);
	  z-index: 350;
	  display: none;
	  align-items: center;
	  justify-content: center;
	}
	.confirm-overlay.active {
	  display: flex;
	}
	.confirm-box {
	  background: #fdf8f0;
	  border-radius: 16px 8px;
	  padding: 24px;
	  max-width: 320px;
	  width: 85%;
	  border: 3px solid #d4c4a8;
	  box-shadow: 8px 8px 0 rgba(100, 60, 20, .3);
	  text-align: center;
	}
	.confirm-box p {
	  margin-bottom: 20px;
	  color: #5c3020;
	  font-weight: 700;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: 1.1rem;
	}
	
	/* 工具箱按钮 - 电脑端在左下角 */
	.toolbox-container {
	  position: fixed;
	  bottom: 20px;
	  left: 20px;
	  z-index: 150;
	  display: flex;
	  flex-direction: column;
	  align-items: flex-start;
	}
	.toolbox-btn {
	  width: 52px;
	  height: 52px;
	  border-radius: 50%;
	  background: #fefcf8;
	  border: 2.5px solid #d4956b;
	  font-size: 1.8rem;
	  cursor: pointer;
	  box-shadow: 4px 4px 0 rgba(180, 120, 70, 0.3);
	  transition: all 0.25s ease;
	  display: flex;
	  align-items: center;
	  justify-content: center;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  color: #d4956b;
	  background: #fefcf8;
	}
	.toolbox-btn:hover {
	  transform: translateY(-2px);
	  box-shadow: 6px 6px 0 rgba(180, 120, 70, 0.35);
	  background: #fce8d5;
	}
	.toolbox-menu {
	  position: absolute;
	  bottom: 60px;
	  left: 0;
	  background: #fdf8f0;
	  border: 2px solid #d4c4a8;
	  border-radius: 20px 12px;
	  box-shadow: 6px 6px 0 rgba(100, 60, 20, 0.25);
	  min-width: 160px;
	  overflow: hidden;
	  opacity: 0;
	  visibility: hidden;
	  transform: translateY(10px);
	  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	  backdrop-filter: blur(4px);
	}
	.toolbox-menu.active {
	  opacity: 1;
	  visibility: visible;
	  transform: translateY(0);
	}
	.toolbox-item {
	  display: flex;
	  align-items: center;
	  gap: 12px;
	  padding: 12px 18px;
	  cursor: pointer;
	  transition: background 0.2s ease;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: 0.95rem;
	  color: #4a3728;
	  border-bottom: 1px solid #e8dcc8;
	}
	.toolbox-item:last-child {
	  border-bottom: none;
	}
	.toolbox-item:hover {
	  background: #fce8d5;
	}
	.toolbox-item-danger:hover {
	  background: #fce8d5;
	  color: #c06060;
	}
	.toolbox-icon {
	  font-size: 1.2rem;
	  width: 28px;
	  text-align: center;
	}
	.toolbox-label {
	  flex: 1;
	  font-weight: 600;
	}
	body.rtl .toolbox-container {
	  left: auto;
	  right: 20px;
	}
	body.rtl .toolbox-menu {
	  left: auto;
	  right: 0;
	}
	
	/* 导入日程确认弹窗 */
	#importConfirmOverlay {
	  position: fixed;
	  inset: 0;
	  background: rgba(40, 25, 10, 0.55);
	  z-index: 360;
	  display: none;
	  align-items: center;
	  justify-content: center;
	}
	#importConfirmOverlay.active {
	  display: flex;
	}
	.import-confirm-box {
	  background: #fdf8f0;
	  border-radius: 16px 8px;
	  padding: 28px 24px;
	  max-width: 380px;
	  width: 85%;
	  border: 3px solid #d4c4a8;
	  box-shadow: 8px 8px 0 rgba(100, 60, 20, 0.3);
	  text-align: center;
	}
	.import-confirm-box p {
	  margin-bottom: 20px;
	  color: #5c3020;
	  font-weight: 600;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: 1rem;
	  line-height: 1.5;
	}
	.import-confirm-box .warning-title {
	  font-size: 1.2rem;
	  font-weight: 700;
	  margin-bottom: 12px;
	  color: #c06060;
	}
	.import-confirm-box .btn-row {
	  display: flex;
	  gap: 12px;
	  justify-content: center;
	  margin-top: 20px;
	}
	
	/* Tooltip 样式 */
	.tooltip {
	  position: fixed;
	  z-index: 500;
	  background: #4a3728;
	  color: #fefcf8;
	  font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
	  font-size: 0.75rem;
	  padding: 8px 14px;
	  border-radius: 12px 8px;
	  max-width: 280px;
	  text-align: left;
	  line-height: 1.4;
	  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
	  pointer-events: none;
	  white-space: normal;
	  word-wrap: break-word;
	  opacity: 0;
	  transition: opacity 0.2s ease;
	}
	body.rtl .tooltip {
	  text-align: right;
	}
	.tooltip.visible {
	  opacity: 1;
	}

/* ========= 手机端全面优化 (仅 ≤768px) ========= */
@media (max-width: 768px) {
  /* 1. 个人信息输入页面优化 */
  .input-card {
    padding: 24px 20px;
    max-width: 90%;
  }
  
  .input-card h1 {
    font-size: 1.6rem;
  }
  
  .input-card p {
    font-size: 0.85rem;
    margin-bottom: 16px;
  }
  
  .input-card label {
    font-size: 0.9rem;
    margin: 8px 0 2px 2px;
  }
  
  .input-card input,
  .input-card select {
    padding: 10px 14px;
    font-size: 0.95rem;
  }
  
  /* 出生日期行：强制同一行，不换行，并增加内边距避免拥挤 */
  .date-row {
    display: flex;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px;
    width: 100%;
  }
  
  .date-row select {
    flex: 1 !important;
    min-width: 0 !important;
    width: auto !important;
    font-size: 0.85rem;
    padding: 8px 10px;   /* 增加左右内边距，避免文字贴边 */
    text-align: left;
  }
  
  /* 寿命行 */
  .life-row {
    flex-wrap: wrap;
  }
  
  .life-row input {
    flex: 2;
    min-width: 100px;
  }
  
  .life-row span {
    flex: 0;
  }
  
  /* 按钮：占满整行，文字不换行 */
  .btn-go {
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 10px 12px;
    font-size: 0.9rem;
    margin-top: 18px;
    box-sizing: border-box;
  }
  
  /* 2. 弹窗优化 - 缩小面积 */
  .modal-box {
    padding: 14px 12px;
    width: 92%;
    max-width: 360px;
    max-height: 75vh;
  }
  
  .modal-box h3 {
    font-size: 0.95rem !important;
    margin-bottom: 8px !important;
  }
  
  .type-tags {
    gap: 4px;
    margin: 8px 0;
  }
  
  .type-tag {
    padding: 2px 6px;
    font-size: 0.65rem;
  }
  
  .form-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 8px 0;
  }
  
  .form-row label:first-child {
    width: auto;
    text-align: left;
    font-size: 0.75rem;
  }
  
  .all-day-row {
    flex-direction: row;
    justify-content: space-between;
  }
  
  .all-day-row label:first-child {
    width: auto;
  }
  
  .form-row input,
  .form-row select,
  .form-row .date-input,
  .form-row .time-input {
    width: 100% !important;
    flex: none !important;
    padding: 6px 8px;
    font-size: 0.8rem;
  }
  
  .modal-textarea {
    padding: 6px 8px;
    font-size: 0.8rem;
  }
  
  .hand-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  
  .btn-row {
    gap: 6px;
    margin-top: 10px;
  }
  
  /* toggle 开关缩小 */
  .toggle-switch {
    width: 40px;
    height: 20px;
  }
  
  .toggle-slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
  }
  
  input:checked + .toggle-slider:before {
    transform: translateX(20px);
  }
  
  /* 3. 侧边栏优化 */
  .sidebar-overlay {
    width: 85vw !important;
  }
  
  .sidebar-header .sb-date {
    font-size: 1.5rem;
  }
  
  .time-hour-label {
    width: 36px;
    font-size: 0.65rem;
  }
  
  .time-hour-line {
    left: 44px;
  }
  
  .time-event-block {
    left: 48px;
    font-size: 0.65rem;
    padding: 2px 3px;
  }
  
  .todo-item {
    padding: 6px 8px;
  }
  
  .todo-title {
    font-size: 0.75rem;
  }
  
  .todo-checkbox {
    width: 16px;
    height: 16px;
  }
  
  /* 4. 控制栏优化 - 居中 */
  .controls {
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    gap: 6px;
  }
  
  .ctrl-btn {
    padding: 4px 10px;
    font-size: 0.7rem;
    line-height: 1.2;
  }
  
  /* 手机端原工具箱隐藏 */
  .toolbox-container {
    display: none;
  }
  
  /* 控制栏内的工具箱按钮样式 */
  .ctrl-btn.toolbox-ctrl-btn {
    font-size: 0.9rem;
    padding: 4px 8px;
  }
  
  /* 手机端菜单定位样式 */
  #mobileToolboxMenu {
    position: fixed;
    z-index: 1000;
    background: #fdf8f0;
    border: 2px solid #d4c4a8;
    border-radius: 20px 12px;
    box-shadow: 6px 6px 0 rgba(100, 60, 20, 0.25);
    min-width: 140px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  #mobileToolboxMenu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  #mobileToolboxMenu .toolbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.8rem;
    color: #4a3728;
    border-bottom: 1px solid #e8dcc8;
  }
  
  #mobileToolboxMenu .toolbox-item:last-child {
    border-bottom: none;
  }
  
  #mobileToolboxMenu .toolbox-item:hover {
    background: #fce8d5;
  }
  
  #mobileToolboxMenu .toolbox-icon {
    font-size: 1rem;
    width: 24px;
    text-align: center;
  }
  
  #mobileToolboxMenu .toolbox-label {
    flex: 1;
    font-weight: 500;
  }
  
  /* ===== 手机端语言切换按钮（左上角） ===== */
  /* 隐藏原有的 select */
  .lang-sel {
    display: none !important;
  }
  
  /* 独立的地球图标按钮 - 左上角 */
  .mobile-lang-btn {
    position: fixed;
    top: 14px;
    left: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fefcf8;
    border: 2px solid #d4c4a8;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 0 rgba(150, 120, 80, .15);
    transition: all 0.2s;
    color: #d4956b;
    z-index: 10000;
    pointer-events: auto;
  }
  
  .mobile-lang-btn:hover {
    transform: scale(1.05);
    border-color: var(--accent);
  }
  
  body.rtl .mobile-lang-btn {
    left: auto;
    right: 14px;
  }
  
  /* 语言选择菜单 */
  .mobile-lang-menu {
    position: fixed;
    top: 60px;
    left: 14px;
    z-index: 10000;
    background: #fdf8f0;
    border: 2px solid #d4c4a8;
    border-radius: 16px 8px;
    box-shadow: 6px 6px 0 rgba(100, 60, 20, 0.25);
    min-width: 150px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
  }
  
  body.rtl .mobile-lang-menu {
    left: auto;
    right: 14px;
  }
  
  .mobile-lang-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  .mobile-lang-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #4a3728;
    transition: background 0.2s;
    font-family: 'Playpen Sans', 'Zen Maru Gothic', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    border-bottom: 1px solid #e8dcc8;
    white-space: nowrap;
  }
  
  .mobile-lang-item:last-child {
    border-bottom: none;
  }
  
  .mobile-lang-item:hover {
    background: #fce8d5;
  }
  
  /* 缩放提示手势优化 */
  .zoom-hint {
    top: 70px;
    font-size: 0.9rem;
  }
}

/* ========= 电脑端保持原有语言选择器可见 ========= */
@media (min-width: 769px) {
  .lang-sel {
    display: block !important;
  }
  
  .mobile-lang-btn,
  .mobile-lang-menu {
    display: none !important;
  }
}

/* ========= 超小手机额外优化 ========= */
@media (max-width: 480px) {
  .input-card {
    padding: 16px 12px;
  }
  
  .input-card h1 {
    font-size: 1.3rem;
  }
  
  .date-row {
    gap: 4px;
  }
  
  .date-row select {
    font-size: 0.75rem;
    padding: 6px 8px;
  }
  
  .btn-go {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  
  .modal-box {
    padding: 10px 10px;
    width: 95%;
    max-width: 320px;
  }
  
  .ctrl-btn {
    padding: 3px 8px;
    font-size: 0.65rem;
  }
  
  .hand-btn {
    padding: 5px 10px;
    font-size: 0.7rem;
  }
  
  .ctrl-btn.toolbox-ctrl-btn {
    padding: 3px 6px;
    font-size: 0.8rem;
  }
  
  .mobile-lang-btn {
    width: 34px;
    height: 34px;
    font-size: 1rem;
    top: 10px;
    left: 10px;
  }
  
  body.rtl .mobile-lang-btn {
    left: auto;
    right: 10px;
  }
}

/* ========= 手势动画样式 ========= */
.zoom-hint.gesture-hint {
  background: rgba(254, 252, 247, 0.85);
  border-radius: 40px;
  padding: 8px 16px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  backdrop-filter: blur(8px);
}

.gesture-icon {
  display: inline-block;
  animation: pinchGesture 1.2s ease-in-out infinite;
  transform-origin: center;
  font-size: 1.5rem;
}

@keyframes pinchGesture {
  0% { transform: scale(1); }
  50% { transform: scale(0.7); }
  100% { transform: scale(1); }
}

.gesture-arrow {
  display: inline-block;
  animation: arrowPulse 1.2s ease-in-out infinite;
  font-size: 1rem;
  opacity: 0.6;
}

@keyframes arrowPulse {
  0% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(4px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0.6; }
}
