:root {
  --blue: #1462d8;
  --ink: #142b4b;
  --muted: #566982;
  --line: #dbe5f1;
  --paper: #fff;
  --soft: #f2f7fd;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: #f4f7fb;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header { height: 68px; padding: 0 clamp(16px, 5vw, 56px); display: flex; justify-content: space-between; align-items: center; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand, .account { display: flex; align-items: center; gap: 14px; font-weight: 650; }
.logotype { color: white; background: var(--blue); border-radius: 9px; padding: 6px 10px; letter-spacing: .12em; }
main { max-width: 1150px; margin: auto; padding: 35px 22px; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 3px 0 22px; }
.eyebrow { color: var(--blue); font-size: 14px; font-weight: 650; }
h1 { margin: 6px 0 0; letter-spacing: -.035em; font-size: clamp(29px, 5vw, 46px); line-height: 1.18; }
h2 { margin: 0; font-size: 20px; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { padding: 10px; min-height: 41px; width: 100%; background: white; border: 1px solid #bccde1; border-radius: 8px; }
textarea { resize: vertical; }
button { background: white; border: 1px solid #bccde1; border-radius: 8px; padding: 9px 12px; cursor: pointer; min-height: 40px; }
button:hover { background: #eaf3fe; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 3px solid #4289fb; outline-offset: 2px; }
.primary { background: var(--blue); border-color: var(--blue); color: white; font-weight: 650; }
.primary:hover { background: #104db1; }
.quiet { border-color: transparent; color: var(--muted); }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; min-width: 0; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs button { border-color: transparent; background: transparent; }
.tabs button[aria-pressed=true] { color: #0d51b8; background: #dfedff; font-weight: 700; }
.content { display: grid; grid-template-columns: 245px minmax(0, 1fr); align-items: start; gap: 16px; }
aside, .schedule, .login { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
aside, #availability, form { display: grid; gap: 12px; }
.dateActions { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; }
.dateActions button { font-size: 12px; padding: 6px 3px; }
.timezone, .hint, .empty, .meta { color: var(--muted); font-size: 13px; }
.timezone, .hint, #availabilityResult { margin: 0; line-height: 1.5; }
.listHead, .dialogHead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.listHead select { min-height: 36px; }
.item { display: grid; grid-template-columns: 110px minmax(0,1fr) auto; gap: 12px; align-items: start; padding: 14px 10px; border-top: 1px solid var(--line); }
.item > div, .item h3 { min-width: 0; overflow-wrap: anywhere; }
.item h3 { font-size: 17px; line-height: 1.4; margin: 0 0 4px; }
.when { color: #174a86; font-size: 13px; padding-top: 4px; }
.item p { margin: 5px 0 0; white-space: pre-wrap; }
.rowActions { display: flex; flex-wrap: wrap; gap: 5px; }
.rowActions button { min-height: 34px; padding: 5px 8px; font-size: 13px; }
.tag { display: inline-block; padding: 2px 6px; margin-right: 6px; border-radius: 6px; background: #e7f0ff; color: #1453ad; }
.tag[data-category="个人事务"] { background: #ffeedc; color: #8d4304; }
.tag[data-category="家人安排"] { background: #e1f3eb; color: #186045; }
.busy { background: var(--soft); }
.empty { padding: 15px 0; }
.login { max-width: 390px; margin: 4vh auto; padding: 26px; }
.login h1 { font-size: 27px; margin-bottom: 18px; }
dialog { width: min(560px, 95vw); max-height: 90vh; border: 1px solid var(--line); border-radius: 15px; padding: 20px; color: var(--ink); }
dialog::backdrop { background: #172e5090; }
.dialogHead { margin-bottom: 0; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.dialogActions { display: flex; gap: 10px; justify-content: end; }
#status, #editorError { color: #94340a; background: #fff4e5; padding: 10px; border-radius: 8px; overflow-wrap: anywhere; }
.sr { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
@media (max-width: 650px) {
  main { padding: 22px 12px; }
  .content { grid-template-columns: 1fr; }
  aside, .schedule { padding: 12px; }
  .item { grid-template-columns: 83px minmax(0,1fr); gap: 8px; }
  .rowActions { grid-column: 2; }
  .fields input { padding: 6px 3px; }
}

/* Calendar */
.calendarControls { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:14px; }
.calendarControls button { min-width:42px; }
.calendarControls button[aria-pressed="true"] { background:var(--blue); border-color:var(--blue); color:white; }
.calendarFilter { margin-left:auto; }
.calendarHeading { margin-bottom:8px; }
.calendarLegend { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:14px; }
.calendarKey { font-size:13px; border-radius:6px; padding:3px 7px; }
.work { background:#d9eaff; color:#124c99; }
.personal { background:#ffebd7; color:#904305; }
.family { background:#dff3e9; color:#176244; }
.occupied { background:#e5e9ef; color:#354760; }
.picked { background:#1462d8; color:#fff; }
.calendar { margin-bottom:20px; }
.calendarGrid { display:grid; gap:5px; }
.calendarMonth, .calendarWeek { grid-template-columns:repeat(7,minmax(0,1fr)); }
.calendarYear { grid-template-columns:repeat(4,minmax(0,1fr)); }
.calendarDate { display:flex; flex-direction:column; gap:5px; text-align:left; min-height:72px; padding:6px; min-width:0; }
.calendarWeek .calendarDate { min-height:128px; }
.calendarDate strong, .weekday { font-size:13px; }
.calendarToday { border:2px solid #1462d8; }
.weekday { text-align:center; color:var(--muted); }
.calendarChip { display:block; width:100%; border-radius:4px; padding:2px 4px; font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.calendarHint { color:var(--muted); font-size:12px; }
.calendarYear progress { width:100%; height:8px; accent-color:var(--blue); }
.calendarHours { display:flex; justify-content:space-between; color:var(--muted); font-size:12px; margin:5px 0; }
.calendarTrack { position:relative; height:32px; border:1px solid var(--line); border-radius:6px; margin-bottom:5px; overflow:hidden;
  background:repeating-linear-gradient(to right, #f4f7fb 0 calc(100% / 6 - 1px), #dbe5f1 calc(100% / 6 - 1px) calc(100% / 6)); }
.calendarBlock { position:absolute; top:2px; bottom:2px; border-radius:4px; padding:3px; overflow:hidden; white-space:nowrap; font-size:12px; }
.calendarPick { touch-action:none; user-select:none; cursor:crosshair; display:grid; place-items:center; height:40px; }
.calendarChooser strong { font-size:14px; }
.eyebrow:empty { display:none; }
@media(max-width:650px) {
  .calendarWeek { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .calendarWeek .calendarDate { min-height:72px; }
  .calendarYear { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .calendarMonth .calendarDate { padding:3px; gap:4px; min-height:52px; }
  .calendarMonth .calendarChip { font-size:10px; padding:1px 2px; }
  .calendarMonth .calendarHint { font-size:10px; }
}

.assignee-field { margin:0; padding:6px 8px; border:1px solid var(--line); border-radius:8px; min-width:0; }
.assignee-field legend { font-size:14px; font-weight:600; }
.assignee-option { display:flex; align-items:center; gap:8px; padding:4px; }
.assignee-option input { width:18px; min-height:18px; margin:0; accent-color:var(--blue); }

.introActions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; }
.intakeInputs, #intakeDrafts { display:grid; gap:12px; margin:14px 0; }
#intakeExample { margin-top:14px; }
#intakeStatus { font-size:14px; color:var(--muted); }
.intakeDraft { padding:12px; background:var(--soft); border-radius:8px; }
.intakeDraft h3, .intakeDraft p { margin:0 0 6px; overflow-wrap:anywhere; }
