/* ============================================================
   李小雨时间管理系统 - 前台样式（仅适配平板 / 简洁友好）
   ============================================================ */

:root{
  --bg:            #FFF7F0;
  --card:          #FFFFFF;
  --ink:           #3B3A45;
  --ink-2:         #6B6A78;
  --ink-3:         #9A99A8;
  --line:          #F0E6DC;
  --primary:       #FF8A65;
  --primary-2:     #FFB74D;
  --primary-soft:  #FFEDE4;
  --ok:            #66BB6A;
  --warn:          #FFA726;
  --danger:        #EF5350;
  --danger-soft:   #FFEBEE;
  --radius:        22px;
  --radius-sm:     14px;
  --radius-lg:     32px;
  --shadow:        0 10px 30px rgba(196,150,120,.14);
  --shadow-lg:     0 18px 50px rgba(196,150,120,.20);
  --font:          -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
                   "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

*{ box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* ------------------------------------------------------------
   [hidden] 全局兜底：必须放在所有组件样式之前，
   否则 .modal-mask{display:flex} 等规则会覆盖 hidden 属性，
   导致弹层/区块在页面加载时就显示且无法关闭。
   ------------------------------------------------------------ */
[hidden]{
  display: none !important;
  visibility: hidden !important;
}

html, body{
  margin: 0; padding: 0;
  width: 100%; min-height: 100%;
  overflow-x: hidden;
}

body{
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 12% -8%, #FFE7D6 0%, rgba(255,231,214,0) 60%),
    radial-gradient(900px 500px at 92% 4%, #E8F4FF 0%, rgba(232,244,255,0) 62%),
    radial-gradient(800px 600px at 50% 108%, #FFF0DC 0%, rgba(255,240,220,0) 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  font-size: 17px;
  line-height: 1.6;
}

#app{ width: 100%; max-width: 100%; overflow-x: hidden; }

h1,h2,h3,h4,p,ul,ol{ margin: 0; }
ul,ol{ padding: 0; list-style: none; }
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img{ max-width: 100%; display: block; }

/* ---------------- 通用按钮 ---------------- */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px;
  font-size: 17px; font-weight: 600;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
  white-space: nowrap; user-select: none;
}
.btn:active{ transform: scale(.97); }
.btn-primary{
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff; box-shadow: 0 10px 24px rgba(255,138,101,.34);
}
.btn-primary:disabled{ background: #E6E1DC; color: #B4AFA9; box-shadow: none; cursor: not-allowed; }
.btn-ghost{ background: #fff; color: var(--ink-2); border: 2px solid var(--line); }
.btn-lg{ padding: 18px 34px; font-size: 19px; }
.btn-block{ width: 100%; }

.icon-btn{
  width: 46px; height: 46px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow); font-size: 20px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:active{ transform: scale(.94); }

.section-label{
  font-size: 18px; font-weight: 700; color: var(--ink);
  margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}

.count-badge{
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 14px; font-weight: 700;
}

/* ============================================================
   首页
   ============================================================ */
.home-wrap{
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 32px; overflow: hidden;
}
.home-deco{ position: absolute; border-radius: 50%; filter: blur(46px); opacity: .55; pointer-events: none; }
.home-deco-1{ width: 420px; height: 420px; background: #FFD9C2; top: -140px; left: -120px; }
.home-deco-2{ width: 380px; height: 380px; background: #CFE8FF; bottom: -150px; right: -110px; }
.home-deco-3{ width: 300px; height: 300px; background: #FFE9B8; top: 42%; right: 12%; opacity: .38; }

.home-inner{
  position: relative; z-index: 2;
  width: 100%; max-width: 720px; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}

.home-greeting{ font-size: 20px; color: var(--ink-2); letter-spacing: .5px; margin-bottom: 10px; }
.home-title{
  font-size: 40px; line-height: 1.28; font-weight: 800; letter-spacing: -.5px;
  background: linear-gradient(135deg, #FF8A65 0%, #FFB74D 60%, #FFA726 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; margin-bottom: 12px;
}
.home-subtitle{ font-size: 19px; color: var(--ink-2); margin-bottom: 46px; }

/* 圆形大按钮 */
.big-circle-btn{
  position: relative; width: 300px; height: 300px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #FF9E7D 0%, #FF8A65 45%, #FFB74D 100%);
  box-shadow:
    0 24px 60px rgba(255,138,101,.42),
    inset 0 -10px 26px rgba(214,96,60,.28),
    inset 0 10px 26px rgba(255,255,255,.42);
  transition: transform .2s ease, box-shadow .2s ease;
  margin-bottom: 34px;
}
.big-circle-btn:active{
  transform: scale(.955);
  box-shadow:
    0 12px 32px rgba(255,138,101,.36),
    inset 0 -6px 18px rgba(214,96,60,.30),
    inset 0 6px 18px rgba(255,255,255,.36);
}
.circle-ring{
  position: absolute; inset: -16px; border-radius: 50%;
  border: 3px solid rgba(255,138,101,.28);
  animation: ringPulse 3.2s ease-out infinite;
}
.circle-ring-2{ inset: -34px; border-color: rgba(255,183,77,.20); animation-delay: 1.1s; }
@keyframes ringPulse{
  0%   { transform: scale(.94); opacity: .85; }
  70%  { transform: scale(1.06); opacity: 0; }
  100% { transform: scale(1.06); opacity: 0; }
}
.circle-inner{
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 10px; color: #fff;
}
.circle-icon{ font-size: 54px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(160,70,40,.28)); }
.circle-text{
  font-size: 27px; font-weight: 800; line-height: 1.24; letter-spacing: 1px;
  text-shadow: 0 3px 10px rgba(160,70,40,.28);
}

.home-tip{
  min-height: 30px; font-size: 18px; color: var(--ink-2);
  transition: opacity .4s ease; margin-bottom: 18px;
}

.home-status{
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 22px; border-radius: 999px;
  background: #fff; box-shadow: var(--shadow);
  font-size: 17px; color: var(--ink-2);
}
.status-dot{
  width: 10px; height: 10px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(102,187,106,.6);
  animation: dotPulse 1.8s infinite;
}
@keyframes dotPulse{
  0%   { box-shadow: 0 0 0 0 rgba(102,187,106,.55); }
  70%  { box-shadow: 0 0 0 12px rgba(102,187,106,0); }
  100% { box-shadow: 0 0 0 0 rgba(102,187,106,0); }
}
.status-link{ color: var(--primary); font-weight: 700; }

/* ============================================================
   创建计划页
   ============================================================ */
.plan-wrap{
  width: 100%; max-width: 980px; margin: 0 auto;
  padding: 40px 32px 160px;
}

.page-head{ position: relative; text-align: center; margin-bottom: 34px; }
.back-btn{
  position: absolute; left: 0; top: 4px;
  width: 48px; height: 48px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--ink-2);
}
.back-btn:active{ transform: scale(.94); }
.page-title{ font-size: 32px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 8px; }
.page-sub{ font-size: 17px; color: var(--ink-2); }

/* 事项选择 */
.cat-picker{ margin-bottom: 34px; }
.cat-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.cat-chip{
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border-radius: var(--radius-sm);
  background: #fff; border: 2px solid transparent;
  box-shadow: var(--shadow);
  font-size: 17px; font-weight: 600; color: var(--ink);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
  position: relative; overflow: hidden;
}
.cat-chip::before{
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 5px; background: var(--c, var(--primary)); opacity: .85;
}
.cat-chip:active{ transform: scale(.96); }
.cat-chip.on{ border-color: var(--c, var(--primary)); box-shadow: 0 12px 28px rgba(196,150,120,.22); }
.cat-emoji{ font-size: 24px; line-height: 1; }
.cat-name{ white-space: nowrap; }

/* 计划列表 */
.item-list-wrap{ margin-bottom: 30px; }
.item-list{ display: flex; flex-direction: column; gap: 14px; }

.empty-hint{
  padding: 46px 24px; text-align: center;
  border-radius: var(--radius);
  background: rgba(255,255,255,.72);
  border: 2px dashed var(--line);
  color: var(--ink-3);
}
.empty-emoji{ font-size: 46px; margin-bottom: 10px; }

.plan-item{
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 22px; border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  animation: itemIn .28s ease both;
}
@keyframes itemIn{
  from{ opacity: 0; transform: translateY(10px); }
  to  { opacity: 1; transform: translateY(0); }
}
.plan-item::before{
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 6px; background: var(--c, var(--primary));
}
.pi-index{
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.pi-body{ flex: 1 1 auto; min-width: 0; }
.pi-top{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.pi-cat{ font-weight: 700; font-size: 18px; }
.pi-content{
  font-size: 17px; color: var(--ink-2); line-height: 1.55;
  word-break: break-word; white-space: pre-wrap; margin-bottom: 10px;
}
.pi-meta{ display: flex; flex-wrap: wrap; gap: 8px; }
.pi-tag{
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  background: #FBF6F1; color: var(--ink-2);
  font-size: 14px; font-weight: 600;
}
.pi-tag.time{ background: #EAF6FF; color: #3E8FC7; }
.pi-tag.deadline{ background: #FFF4E3; color: #C77F1E; }
.pi-actions{ flex: 0 0 auto; display: flex; gap: 8px; }
.pi-btn{
  width: 40px; height: 40px; border-radius: 12px;
  background: #FBF6F1;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--ink-2);
}
.pi-btn:active{ transform: scale(.92); }
.pi-btn.del{ background: var(--danger-soft); color: var(--danger); }

/* 底部操作 */
.plan-actions{
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; gap: 14px; justify-content: center;
  padding: 18px 32px calc(18px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(255,247,240,.98) 55%, rgba(255,247,240,0));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.plan-actions .btn{ flex: 0 1 320px; }

/* ============================================================
   弹层 / 表单
   ============================================================ */
.modal-mask{
  position: fixed; inset: 0; z-index: 100;
  background: rgba(58,50,44,.42);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 28px;
  animation: fadeIn .18s ease both;
}
@keyframes fadeIn{ from{ opacity: 0; } to{ opacity: 1; } }

.modal-card{
  width: 100%; max-width: 640px; max-height: 88vh;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modalIn .24s cubic-bezier(.2,.9,.3,1.1) both;
}
.modal-card.modal-small{ max-width: 460px; }
@keyframes modalIn{
  from{ opacity: 0; transform: translateY(24px) scale(.97); }
  to  { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head{
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px 14px;
}
.modal-head h3{ font-size: 22px; font-weight: 800; }
.modal-close{
  width: 38px; height: 38px; border-radius: 50%;
  background: #FBF6F1; color: var(--ink-2); font-size: 17px;
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-body{ padding: 6px 28px 20px; }
.modal-body.center{ text-align: center; padding-top: 30px; }
.modal-foot{
  display: flex; gap: 12px; justify-content: flex-end;
  padding: 16px 28px calc(24px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}
.modal-foot.center{ justify-content: center; }

.form-row{ margin-bottom: 20px; }
.form-row-2{ display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-label{
  display: block; font-size: 16px; font-weight: 700;
  color: var(--ink); margin-bottom: 9px;
}
.req{ color: var(--danger); }
.form-input{
  width: 100%; padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: #FDFBF9;
  font-size: 17px; font-family: inherit; color: var(--ink);
  transition: border-color .16s ease, background .16s ease;
  -webkit-appearance: none; appearance: none;
}
.form-input:focus{ outline: none; border-color: var(--primary); background: #fff; }
.form-textarea{ resize: vertical; min-height: 92px; line-height: 1.6; }
.form-hint{ margin-top: 7px; font-size: 14px; color: var(--ink-3); }

/* 具体内容 - 自动编号小工具 */
.content-tools{
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-bottom: 10px;
}
.tool-chip{
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 999px;
  border: 2px solid var(--line); background: #FDFBF9;
  font-size: 15px; font-weight: 700; color: var(--ink-2);
  font-family: inherit; cursor: pointer;
  transition: all .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.tool-chip .tool-ico{
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 4px;
  border-radius: 7px; background: var(--primary-soft);
  color: var(--primary); font-size: 13px; font-weight: 800;
}
.tool-chip:hover{ border-color: var(--primary); color: var(--primary); }
.tool-chip.on{
  border-color: var(--primary); background: var(--primary-soft);
  color: var(--primary); box-shadow: 0 6px 16px rgba(196,150,120,.18);
}
.tool-chip.on .tool-ico{ background: var(--primary); color: #fff; }
.tool-tip{ font-size: 13px; color: var(--ink-3); }

.modal-cat{ display: flex; flex-wrap: wrap; gap: 9px; }
.modal-cat .cat-chip{
  padding: 10px 15px; font-size: 15px; box-shadow: none;
  border: 2px solid var(--line); background: #FDFBF9;
}
.modal-cat .cat-chip::before{ display: none; }
.modal-cat .cat-chip.on{
  border-color: var(--c, var(--primary)); background: #fff;
  box-shadow: 0 6px 16px rgba(196,150,120,.16);
}
.modal-cat .cat-emoji{ font-size: 19px; }

.quick-minutes{ display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick-minutes button{
  padding: 7px 15px; border-radius: 999px;
  background: #FBF6F1; color: var(--ink-2);
  font-size: 15px; font-weight: 600;
}
.quick-minutes button.on{ background: var(--primary-soft); color: var(--primary); }

/* ============================================================
   计时页
   ============================================================ */
.timer-wrap{
  position: relative;
  width: 100%; max-width: 980px; margin: 0 auto;
  padding: 34px 32px 80px;
  min-height: 100vh; min-height: 100dvh;
}

/* 泛红闪烁边框 */
.alert-frame{
  position: fixed; inset: 0; z-index: 60;
  pointer-events: none; opacity: 0;
  box-shadow: inset 0 0 0 0 rgba(239,83,80,0);
  transition: opacity .3s ease;
}
.alert-frame.on{ opacity: 1; animation: alertFlash 1.15s ease-in-out infinite; }
.alert-frame.danger{ animation: alertFlashFast .72s ease-in-out infinite; }
@keyframes alertFlash{
  0%,100%{ box-shadow: inset 0 0 0 10px rgba(239,83,80,.16), inset 0 0 90px 20px rgba(239,83,80,.10); }
  50%    { box-shadow: inset 0 0 0 18px rgba(239,83,80,.42), inset 0 0 140px 40px rgba(239,83,80,.24); }
}
@keyframes alertFlashFast{
  0%,100%{ box-shadow: inset 0 0 0 12px rgba(239,83,80,.24), inset 0 0 100px 24px rgba(239,83,80,.14); }
  50%    { box-shadow: inset 0 0 0 22px rgba(239,83,80,.55), inset 0 0 160px 50px rgba(239,83,80,.32); }
}

.timer-head{
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 26px;
}
.timer-head-left{ display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.timer-date{ font-size: 17px; font-weight: 700; color: var(--ink-2); }
.timer-progress{
  padding: 6px 14px; border-radius: 999px;
  background: #fff; box-shadow: var(--shadow);
  font-size: 15px; font-weight: 700; color: var(--primary);
}
.timer-head-right{ flex: 0 0 auto; }
.icon-btn.muted{ opacity: .45; }

/* 当前任务卡片 */
.cur-card{
  position: relative;
  padding: 34px 34px 30px;
  border-radius: var(--radius-lg);
  background: #fff; box-shadow: var(--shadow-lg);
  text-align: center; margin-bottom: 24px;
  overflow: hidden;
  transition: box-shadow .3s ease;
}
.cur-card::before{
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 7px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}
.cur-card.near{ box-shadow: 0 18px 50px rgba(255,167,38,.30); }
.cur-card.over{ box-shadow: 0 18px 50px rgba(239,83,80,.30); }

.cur-cat{
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 17px; font-weight: 700; margin-bottom: 14px;
}
.cur-content{
  font-size: 24px; font-weight: 700; line-height: 1.5;
  color: var(--ink); margin-bottom: 26px;
  word-break: break-word; white-space: pre-wrap;
}

/* 环形时钟 */
.clock-wrap{ position: relative; width: 300px; height: 300px; margin: 0 auto 26px; }
.clock-ring{ width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg{ fill: none; stroke: #F5EDE6; stroke-width: 14; }
.ring-fg{
  fill: none; stroke: var(--primary); stroke-width: 14;
  stroke-linecap: round; stroke-dasharray: 553; stroke-dashoffset: 553;
  transition: stroke-dashoffset .5s linear, stroke .3s ease;
}
.cur-card.near .ring-fg{ stroke: var(--warn); }
.cur-card.over .ring-fg{ stroke: var(--danger); }

.clock-center{
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
}
.clock-time{
  font-size: 52px; font-weight: 800; letter-spacing: 1px;
  font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1;
}
.cur-card.near .clock-time{ color: var(--warn); }
.cur-card.over .clock-time{ color: var(--danger); }
.clock-label{ font-size: 15px; color: var(--ink-3); }

.cur-meta{ display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.meta-item{
  flex: 0 1 180px; padding: 14px 16px;
  border-radius: var(--radius-sm); background: #FBF6F1;
  display: flex; flex-direction: column; gap: 4px;
}
.meta-k{ font-size: 14px; color: var(--ink-3); }
.meta-v{ font-size: 19px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.alert-text{
  margin-top: 20px; padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft); color: var(--danger);
  font-size: 18px; font-weight: 700;
  animation: textBlink 1.1s ease-in-out infinite;
}
@keyframes textBlink{ 0%,100%{ opacity: 1; } 50%{ opacity: .55; } }

/* 暂停按钮组 */
.pause-bar{ display: flex; gap: 16px; justify-content: center; margin-bottom: 20px; }
.pause-btn{
  flex: 0 1 260px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 18px 22px; border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow);
  font-size: 18px; font-weight: 700; color: var(--ink);
  transition: transform .16s ease, box-shadow .16s ease;
}
.pause-btn:active{ transform: scale(.96); }
.pause-btn.active{
  background: linear-gradient(135deg, #FFE0B2, #FFCC80);
  color: #8A5A12;
  box-shadow: 0 12px 30px rgba(255,167,38,.34);
}
.pause-emoji{ font-size: 24px; line-height: 1; }
.pause-label{ white-space: nowrap; }

.btn-finish{
  width: 100%; max-width: 620px; margin: 0 auto 34px;
  display: flex; padding: 22px 30px;
  font-size: 21px; border-radius: var(--radius);
}

/* ============================================================
   下一项待开始（中间态）
   ============================================================ */
.next-block{
  max-width: 620px; margin: 0 auto 34px;
  padding: 34px 30px 30px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: nextIn .45s cubic-bezier(.22,1,.36,1) both;
}

@keyframes nextIn{
  from{ opacity: 0; transform: translateY(18px) scale(.97); }
  to  { opacity: 1; transform: translateY(0) scale(1); }
}

.next-emoji{
  font-size: 46px; line-height: 1;
  margin-bottom: 12px;
  animation: nextBounce 1.8s ease-in-out infinite;
}

@keyframes nextBounce{
  0%, 100%{ transform: translateY(0); }
  50%     { transform: translateY(-8px); }
}

.next-title{
  margin: 0 0 8px;
  font-size: 25px; font-weight: 700;
  color: var(--ink);
  letter-spacing: .5px;
}

.next-hint{
  margin: 0 0 22px;
  font-size: 16px; color: var(--ink-2);
  line-height: 1.6;
}

.next-card{
  padding: 20px 22px;
  margin-bottom: 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary-soft), #FFF9F4);
  border: 1px solid var(--line);
  text-align: left;
}

.next-cat{
  font-size: 15px; font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.next-content{
  font-size: 19px; font-weight: 600;
  color: var(--ink);
  line-height: 1.55;
  word-break: break-word;
}

.next-meta{
  margin-top: 12px;
  font-size: 14px; color: var(--ink-3);
}

.next-block .btn-lg{
  width: 100%;
  font-size: 21px;
  padding: 20px 28px;
  border-radius: var(--radius);
}

/* 进度列表 */
.timer-list{ max-width: 760px; margin: 0 auto; }.progress-list{ display: flex; flex-direction: column; gap: 10px; }
.pg-item{
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; border-radius: var(--radius-sm);
  background: #fff; box-shadow: 0 6px 18px rgba(196,150,120,.10);
  font-size: 16px;
}
.pg-item.done{ opacity: .62; }
.pg-item.running{ box-shadow: 0 8px 24px rgba(255,138,101,.24); }
.pg-dot{
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  background: #F5EDE6; color: var(--ink-3);
  font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.pg-item.done .pg-dot{ background: #E8F5E9; color: var(--ok); }
.pg-item.running .pg-dot{ background: var(--primary-soft); color: var(--primary); }
.pg-body{ flex: 1 1 auto; min-width: 0; }
.pg-name{ font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-sub{ font-size: 14px; color: var(--ink-3); }
.pg-time{
  flex: 0 0 auto; font-size: 15px; font-weight: 700;
  color: var(--ink-2); font-variant-numeric: tabular-nums;
}

/* 空状态 / 完成状态 */
.timer-empty, .timer-done{
  max-width: 620px; margin: 60px auto;
  padding: 56px 34px; border-radius: var(--radius-lg);
  background: #fff; box-shadow: var(--shadow-lg);
  text-align: center;
}
.timer-empty p, .timer-done p{ font-size: 18px; color: var(--ink-2); margin-bottom: 24px; }
.done-emoji{ font-size: 68px; margin-bottom: 14px; }
.done-title{
  font-size: 32px; font-weight: 800; margin-bottom: 12px;
  background: linear-gradient(135deg, #FF8A65, #FFB74D);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.done-text{ font-size: 19px; color: var(--ink-2); line-height: 1.7; margin-bottom: 24px; }
.done-stats{ display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 28px; }
.done-stat{ flex: 0 1 150px; padding: 16px; border-radius: var(--radius-sm); background: #FBF6F1; }
.done-stat b{ display: block; font-size: 22px; color: var(--ink); }
.done-stat span{ font-size: 14px; color: var(--ink-3); }

/* 暂停遮罩 */
.pause-overlay, .eye-overlay{
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: 28px;
  background: rgba(58,50,44,.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fadeIn .2s ease both;
}
.pause-overlay-card, .eye-card{
  width: 100%; max-width: 520px;
  padding: 46px 34px calc(38px + env(safe-area-inset-bottom, 0px));
  border-radius: var(--radius-lg);
  background: #fff; box-shadow: var(--shadow-lg);
  text-align: center;
  animation: modalIn .26s cubic-bezier(.2,.9,.3,1.1) both;
}
.pause-overlay-emoji{ font-size: 62px; margin-bottom: 12px; }
.pause-overlay-title{ font-size: 26px; font-weight: 800; margin-bottom: 16px; }
.pause-overlay-time{
  font-size: 46px; font-weight: 800; color: var(--warn);
  font-variant-numeric: tabular-nums; margin-bottom: 12px;
}
.pause-overlay-hint{ font-size: 17px; color: var(--ink-2); margin-bottom: 28px; }

/* 眼睛休息 */
.eye-emoji{ font-size: 66px; margin-bottom: 12px; animation: eyeBlink 2.6s ease-in-out infinite; }
@keyframes eyeBlink{
  0%,100%{ transform: scale(1); }
  50%    { transform: scale(1.08); }
}
.eye-title{ font-size: 27px; font-weight: 800; margin-bottom: 12px; }
.eye-hint{ font-size: 17px; color: var(--ink-2); margin-bottom: 22px; line-height: 1.7; }
.eye-countdown{
  font-size: 58px; font-weight: 800; color: var(--primary);
  font-variant-numeric: tabular-nums; line-height: 1;
  margin-bottom: 20px;
}
.eye-progress{
  height: 12px; border-radius: 999px;
  background: #F5EDE6; overflow: hidden; margin-bottom: 18px;
}
.eye-progress-bar{
  height: 100%; width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width .5s linear;
}
.eye-sub{ font-size: 15px; color: var(--ink-3); margin-bottom: 26px; }

/* ============================================================
   全局提示 Toast
   ============================================================ */
.toast{
  position: fixed; left: 50%; bottom: 90px;
  transform: translate(-50%, 20px);
  z-index: 300;
  max-width: 80vw;
  padding: 14px 26px;
  border-radius: 999px;
  background: rgba(59,58,69,.92);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease, transform .24s ease;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}
.toast.show{ opacity: 1; transform: translate(-50%, 0); }
.toast.ok{ background: rgba(76,175,80,.95); }
.toast.err{ background: rgba(229,57,53,.95); }

/* ============================================================
   撒花层
   ============================================================ */
.confetti-layer{
  position: fixed; inset: 0; z-index: 250;
  pointer-events: none; overflow: hidden;
}
.confetti-piece{
  position: absolute; top: -20px;
  width: 10px; height: 16px;
  border-radius: 3px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall{
  0%  { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100%{ transform: translateY(105vh) rotate(720deg); opacity: .1; }
}

/* ============================================================
   平板适配（768px ~ 1366px 为主）
   ============================================================ */
@media (max-width: 1024px){
  body{ font-size: 16px; }
  .home-title{ font-size: 34px; }
  .big-circle-btn{ width: 260px; height: 260px; }
  .circle-icon{ font-size: 46px; }
  .circle-text{ font-size: 24px; }
  .clock-wrap{ width: 260px; height: 260px; }
  .clock-time{ font-size: 44px; }
  .cur-content{ font-size: 21px; }
  .plan-wrap, .timer-wrap{ padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 820px){
  .home-title{ font-size: 30px; }
  .home-subtitle{ font-size: 17px; margin-bottom: 34px; }
  .big-circle-btn{ width: 230px; height: 230px; margin-bottom: 28px; }
  .circle-icon{ font-size: 40px; }
  .circle-text{ font-size: 21px; }
  .cat-grid{ grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .form-row-2{ grid-template-columns: 1fr; }
  .pause-bar{ flex-direction: column; align-items: stretch; }
  .pause-btn{ flex: 1 1 auto; }
  .plan-actions{ flex-direction: column-reverse; }
  .plan-actions .btn{ flex: 1 1 auto; width: 100%; }
  .modal-card{ max-height: 92vh; }
  .modal-head{ padding: 20px 20px 12px; }
  .modal-body{ padding: 4px 20px 16px; }
  .modal-foot{ padding: 14px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .clock-wrap{ width: 220px; height: 220px; }
  .clock-time{ font-size: 38px; }
  .cur-card{ padding: 26px 20px 24px; }
  .cur-content{ font-size: 19px; }
  .meta-item{ flex: 1 1 100%; }
  .timer-empty, .timer-done{ padding: 40px 22px; margin: 30px auto; }
  .done-title{ font-size: 26px; }
  .eye-countdown{ font-size: 46px; }
  .pause-overlay-card, .eye-card{ padding: 34px 22px calc(28px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 560px){
  .home-wrap{ padding: 32px 18px; }
  .home-title{ font-size: 25px; }
  .big-circle-btn{ width: 200px; height: 200px; }
  .circle-icon{ font-size: 34px; }
  .circle-text{ font-size: 18px; }
  .plan-wrap, .timer-wrap{ padding-left: 16px; padding-right: 16px; }
  .page-title{ font-size: 24px; }
  .cat-grid{ grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-chip{ padding: 12px 12px; font-size: 15px; }
  .cat-emoji{ font-size: 20px; }
  .plan-item{ padding: 16px 14px; gap: 10px; }
  .pi-actions{ flex-direction: column; }
  .clock-wrap{ width: 190px; height: 190px; }
  .clock-time{ font-size: 32px; }
  .btn-finish{ font-size: 17px; padding: 18px 20px; }
  .toast{ bottom: 110px; font-size: 15px; padding: 12px 20px; }
}

/* 横屏平板（高度较小） */
@media (orientation: landscape) and (max-height: 620px){
  .home-wrap{ padding: 24px; }
  .big-circle-btn{ width: 190px; height: 190px; margin-bottom: 18px; }
  .circle-icon{ font-size: 32px; }
  .circle-text{ font-size: 17px; }
  .home-title{ font-size: 26px; }
  .home-subtitle{ margin-bottom: 20px; }
  .clock-wrap{ width: 180px; height: 180px; }
  .clock-time{ font-size: 30px; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
