/* ============================================================
   KidDaily 日历子页 calendar.html — 基础 + 顶栏 + 工具栏 + 日视图
   由原型机械抽取；页面级别名按 DESIGN §9 覆盖表（零回归关键）
   ============================================================ */

/* DESIGN §9 calendar 页面级 Token 别名覆盖（照抄勿改） */
:root{
  --blue:var(--course-blue);
  --green:var(--course-green);
  --green-bg:var(--course-green-bg);
  --green-soft:var(--course-green-soft);
  --blue-bg:var(--course-blue-bg);
  --blue-soft:var(--course-blue-soft);
  --blue-bar:var(--course-blue-bar);
  --yellow-bg:var(--course-yellow-bg);
  --yellow-ink:var(--course-yellow-ink);
  --yellow-dot:var(--course-yellow-dot);
  --yellow-note:var(--course-yellow-note);
  /* tokens.css 未收编的零散色，页面级别名补录 */
  --cal-nav-hover:#F5F0E8;
  --coral-soft-hover:#F7E3D4;
  --cal-none-border:#E0D8CC;
  --ghost-hover-bg-cal:#F1EBE2;
}

*{margin:0;padding:0;box-sizing:border-box;}
html,body{height:100%;}
body{
  background:var(--stage-bg);
  font-family:var(--font-cn);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  overflow:hidden;
}
button{font-family:inherit;border:none;background:none;cursor:pointer;color:inherit;}
input{font-family:inherit;}

/* ---------- 舞台与缩放 ---------- */
.stage{position:fixed;inset:0;overflow:hidden;}
.page{
  position:absolute;top:0;left:0;
  width:1920px;height:1080px;
  transform-origin:top left;
  background:var(--bg);
  display:flex;flex-direction:column;
  gap:20px;padding:30px;
  overflow:hidden;
}

/* ---------- 顶部栏（抬升层级，避免头像下拉菜单被内容区覆盖） ---------- */
.topbar{
  position:relative;z-index:15;
  width:100%;height:56px;flex:0 0 auto;
  display:flex;align-items:center;justify-content:space-between;
}
.brand{display:flex;align-items:center;gap:12px;}
.logo{
  width:42px;height:42px;border-radius:var(--radius-logo);background:var(--coral);
  display:flex;align-items:center;justify-content:center;flex:0 0 auto;
}
.brand-text{display:flex;flex-direction:column;gap:3px;}
.brand-title{font-size:21px;line-height:27px;font-weight:700;color:var(--ink);}
.brand-sub{font-size:12.5px;line-height:17px;font-weight:400;color:var(--muted);}
.user-area{display:flex;align-items:center;gap:12px;}
.status-pill{
  min-width:156px;height:38px;border-radius:var(--radius-pill);
  background:var(--card);border:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;gap:8px;padding:0 16px;
}
.status-dot{width:8px;height:8px;border-radius:50%;background:var(--status-dot);flex:0 0 auto;}
.status-text{font-size:13px;font-weight:500;color:var(--ink-3);white-space:nowrap;}

/* ---------- 视图切换栏 ---------- */
.toolbar{
  width:100%;height:68px;flex:0 0 auto;
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius-lg);
  display:flex;align-items:center;justify-content:space-between;
  padding:0 20px;
}
.seg{
  display:flex;gap:4px;padding:4px;border-radius:var(--radius-pill);background:var(--field);
}
.seg button{
  width:84px;height:40px;border-radius:var(--radius-pill);
  font-size:15px;font-weight:500;color:var(--muted-2);line-height:20px;
  transition:background-color .16s ease,color .16s ease;
}
.seg button:hover{color:var(--ink-3);}
.seg button.active{background:var(--coral);color:#fff;font-weight:600;}
.seg button:focus-visible{box-shadow:var(--focus-ring);outline:none;}
.btn-add{
  height:40px;padding:0 18px;border-radius:var(--radius-pill);background:var(--coral);
  display:flex;align-items:center;gap:7px;flex:0 0 auto;color:#fff;
  transition:background-color .16s ease,transform .12s ease;
}
.btn-add:hover{background:var(--cal-btn-hover);}
.btn-add:active{transform:translateY(1px);}
.btn-add:focus-visible{box-shadow:var(--focus-ring);outline:none;}
.btn-add span{font-size:14.5px;font-weight:600;line-height:20px;}
.btn-add svg{display:block;}

/* ---------- 视图容器 ---------- */
.view{display:none;flex-direction:column;width:100%;flex:1;min-height:0;}
.view.active{display:flex;}

/* 通用卡片 */
.card{
  background:var(--card);border:1px solid var(--line);
  border-radius:var(--radius-card);box-shadow:var(--shadow-card);
}
.card-head{display:flex;align-items:center;justify-content:space-between;flex:0 0 auto;}
.card-head h3{font-size:16px;font-weight:600;color:var(--ink);line-height:22px;}
.card-head .count{font-size:12.5px;font-weight:400;color:var(--label);line-height:18px;}
.card-head .count--sm{font-size:12px;}

/* 状态胶囊（已完成 / 待完成） */
.pill{
  width:82px;height:32px;border-radius:var(--radius-pill);flex:0 0 auto;
  display:flex;align-items:center;justify-content:center;
  font-size:12.5px;font-weight:600;line-height:18px;
  transition:background-color .16s ease,color .16s ease,transform .12s ease;
}
.pill:active{transform:scale(.96);}
.pill:focus-visible{box-shadow:var(--focus-ring);outline:none;}
.pill--done{background:var(--green-bg);color:var(--green);}
.pill--todo{background:var(--yellow-bg);color:var(--yellow-ink);}

/* 日期头部（日 / 周通用） */
.date-head{height:56px;flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;}
.date-head h2{font-size:24px;line-height:32px;font-weight:700;color:var(--ink);}
.date-head .sub{font-size:13px;line-height:18px;font-weight:400;color:var(--muted);margin-top:4px;}
.date-nav{display:flex;align-items:center;gap:8px;}
.nav-btn{
  width:34px;height:34px;border-radius:17px;background:var(--card);
  border:1px solid var(--line-soft);color:var(--muted-2);
  display:flex;align-items:center;justify-content:center;flex:0 0 auto;
  transition:background-color .16s ease,transform .12s ease;
}
.nav-btn:hover{background:var(--cal-nav-hover);}
.nav-btn:active{transform:scale(.92);}
.nav-btn svg{display:block;}
.today-btn{
  width:74px;height:34px;border-radius:17px;background:var(--coral-soft);
  font-size:13px;font-weight:600;color:var(--coral-deep);line-height:18px;
  transition:background-color .16s ease;
}
.today-btn:hover{background:var(--coral-soft-hover);}

/* ============================================================
   日视图
   ============================================================ */
.day-body{display:flex;gap:20px;flex:1;min-height:0;}
.day-left{flex:1;min-width:0;display:flex;flex-direction:column;gap:14px;}
.day-right{width:960px;flex:0 0 auto;display:flex;flex-direction:column;gap:14px;min-height:0;}

.plan-card{padding:22px;display:flex;flex-direction:column;gap:12px;min-height:0;}
.card--timed{height:366px;flex:0 0 auto;}
.card--flexible{height:212px;flex:0 0 auto;padding:20px;}
.card--long{flex:1;padding:20px;}
.plan-list{display:flex;flex-direction:column;gap:10px;flex:1;min-height:0;overflow:hidden;}

.item-timed{
  height:84px;flex:0 0 auto;border-radius:16px;background:var(--field);
  display:flex;align-items:center;gap:14px;padding:14px 14px 14px 16px;
}
.item-timed .time{width:74px;flex:0 0 auto;display:flex;flex-direction:column;gap:3px;}
.item-timed .time b{font-family:var(--font-num);font-size:17px;line-height:22px;font-weight:600;color:var(--ink-2);}
.item-timed .time i{font-family:var(--font-num);font-style:normal;font-size:10.5px;line-height:14px;color:var(--label);}
.item-timed .info{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px;}
.item-timed .info b{font-size:15px;line-height:21px;font-weight:500;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.item-timed .info i{font-style:normal;font-size:11.5px;line-height:16px;color:var(--muted);}

.item-flex{
  height:62px;flex:0 0 auto;border-radius:14px;background:var(--field);
  display:flex;align-items:center;gap:12px;padding:12px 12px 12px 16px;
}
.item-flex .ic{width:22px;height:22px;flex:0 0 auto;display:flex;align-items:center;justify-content:center;
  color:var(--data-blue);}
.item-flex b{flex:1;min-width:0;font-size:15px;line-height:21px;font-weight:500;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

.item-long{
  height:100px;flex:0 0 auto;border-radius:16px;background:var(--field);
  display:flex;align-items:center;gap:14px;padding:16px;
}
.item-long .ic{width:22px;height:22px;flex:0 0 auto;display:flex;align-items:center;justify-content:center;
  color:var(--pink);}
.item-long .info{flex:1;min-width:0;display:flex;flex-direction:column;gap:8px;}
.item-long .info b{font-size:15px;line-height:21px;font-weight:500;color:var(--ink);}
.item-long .info .range{font-size:11.5px;line-height:16px;color:var(--muted);}
.progress{height:8px;border-radius:4px;background:var(--ring-track);overflow:hidden;}
.progress i{display:block;height:100%;border-radius:4px;background:var(--pink);}

/* 空列表提示 */
.list-empty{padding:8px 0;font-size:12px;line-height:18px;color:var(--muted);}

/* 只读成员隐藏全部写入口（AC-09） */
.is-viewer [data-admin-only]{display:none !important;}
