:root {
  --primary: #007AFF;
  --primary-hover: #0056b3;
  --secondary: #5AC8FA;
  --accent-red: #FF3B30;
  --accent-yellow: #FFCC00;
  --accent-green: #34C759;

  --bg: #F2F4F7;
  --card-bg: #FFFFFF;

  --text: #1D1D1F;
  --text-muted: #86868B;

  --border: #E5E5EA;
  --radius: 16px;
  --shadow: 0 2px 8px rgba(0,0,0,0.04);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.container { overflow-x: hidden; }
.bottom-nav { display: none; }

@media (max-width: 720px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  body { overscroll-behavior-x: none; touch-action: pan-y; }
  .nav { overflow-x: hidden; }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(56px + env(safe-area-inset-bottom));
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    gap: 6px;
    background: rgba(255,255,255,0.92);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(10px);
    z-index: 999;
    box-sizing: border-box;
    transform: translateZ(0);
    will-change: transform;
  }
  .bottom-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    padding: 10px 0;
    border-radius: 12px;
    border: 1px solid transparent;
  }
  .bottom-nav a.active {
    color: var(--primary);
    border-color: rgba(0,122,255,0.25);
    background: rgba(0,122,255,0.06);
    font-weight: 800;
  }
}

@media (max-width: 720px) {
  .timeline-list { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
  .now-marker { scroll-margin-bottom: calc(220px + env(safe-area-inset-bottom)); margin-bottom: calc(110px + env(safe-area-inset-bottom)); }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
a:hover { color: var(--primary); }

a.btn, button.btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,122,255,0.2);
}
a.btn:hover, button.btn:hover { 
  background: var(--primary-hover); 
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,122,255,0.3);
}
a.btn:active, button.btn:active { transform: translateY(0); }

a.btn.secondary, button.btn.secondary, label.btn.secondary {
  background: white;
  color: var(--primary);
  border: 1px solid var(--border);
  box-shadow: none;
}
a.btn.secondary:hover, button.btn.secondary:hover, label.btn.secondary:hover {
  background: #F9F9F9;
  border-color: var(--primary);
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  border: 1px solid white;
}

.flex { display: flex; align-items: center; justify-content: space-between; }
.right { margin-left: auto; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.title { 
  font-size: 20px; 
  font-weight: 600; 
  margin-bottom: 16px; 
  color: var(--text); 
  letter-spacing: -0.5px;
}
.muted { color: var(--text-muted); font-size: 0.9em; }

.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 14px; color: var(--text-muted); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-sizing: border-box;
  font-size: 15px;
  background: #FAFAFA;
  transition: all 0.2s;
  color: var(--text);
}
.field input:focus, .field textarea:focus {
  outline: none; 
  border-color: var(--primary); 
  background: #FFF;
  box-shadow: 0 0 0 3px rgba(0,122,255,0.1);
}

.nav { display: flex; gap: 8px; margin-bottom: 24px; overflow-x: auto; padding-bottom: 5px; }
.nav a {
  padding: 8px 18px;
  border-radius: 20px;
  background: white;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
}
.nav .nav-more {
  padding: 8px 18px;
  border-radius: 20px;
  background: white;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
  border: 0;
  cursor: pointer;
}
.nav-more-menu {
  position: fixed;
  top: 70px;
  right: 16px;
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
  backdrop-filter: blur(12px);
  padding: 8px;
  z-index: 1001;
  display: none;
  min-width: 140px;
}
.nav-more-menu.show { display: block; }
.nav-more-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}
.nav-more-menu a.active { background: rgba(0,122,255,0.08); color: var(--primary); font-weight: 800; }
.nav a:hover { color: var(--primary); background: #F0F8FF; }
.nav a.active { background: var(--primary); color: white; box-shadow: 0 2px 6px rgba(0,122,255,0.2); }

.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { 
  text-align: left; 
  color: var(--text-muted); 
  font-weight: 600; 
  padding: 12px; 
  border-bottom: 1px solid var(--border); 
  font-size: 13px;
  text-transform: uppercase;
}
.table td { padding: 12px; border-bottom: 1px solid #F5F5F5; color: var(--text); }
.table tr:last-child td { border-bottom: none; }

.chip {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  margin-right: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  border: 1px solid transparent;
}
.chip:hover { transform: translateY(-2px); }

.chip:nth-child(4n+1) { background: #E3F2FD; color: #007AFF; }
.chip:nth-child(4n+2) { background: #FFF3E0; color: #FF9500; }
.chip:nth-child(4n+3) { background: #FFEBEE; color: #FF3B30; }
.chip:nth-child(4n+4) { background: #E8F5E9; color: #34C759; }

.clock-widget {
  text-align: center;
  padding: 30px;
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 24px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  position: relative;
}
.clock-widget::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 8px;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  background: linear-gradient(90deg, var(--primary), var(--accent-yellow), var(--accent-red));
}
.clock-time { font-size: 56px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; margin-top: 6px; }
.clock-date { font-size: 15px; color: var(--text-muted); font-weight: 600; }
.clock-couple { margin-top: 10px; font-size: 14px; font-weight: 800; display: inline-block; padding: 6px 12px; border-radius: 999px; background: rgba(255,59,48,0.10); color: var(--accent-red); border: 1px solid rgba(255,59,48,0.18); }

.dash-layout { display: flex; flex-direction: column; gap: 24px; }
.dash-clock { order: 1; }
.dash-search { order: 2; }
.dash-grid { order: 3; }

.search-center {
  max-width: 640px;
  margin: 40px auto;
  text-align: center;
}
.search-input-group {
  display: flex;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  border-radius: 30px;
  overflow: hidden;
  background: white;
  border: 1px solid white;
  transition: all 0.3s;
}
.search-input-group:hover, .search-input-group:focus-within {
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}
.search-input-group select {
  border: none;
  background: #F9F9F9;
  padding: 16px;
  outline: none;
  width: auto;
  min-width: 100px;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}
.search-input-group input {
  flex: 1;
  border: none;
  padding: 16px;
  font-size: 17px;
  outline: none;
  background: white;
}
.search-input-group button {
  border: none;
  background: var(--primary);
  color: white;
  padding: 0 30px;
  font-weight: 600;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
}
.search-input-group button:hover { background: var(--primary-hover); }

.suggestions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.sug-item {
  background: white; 
  padding: 6px 12px; 
  border-radius: 8px; 
  font-size: 12px; 
  cursor: pointer;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.2s;
}
.sug-item:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #F0F8FF;
}

 .quick {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px;
 }
 .quick .chip { flex-shrink: 0; }

 .time-field { position: relative; }
 .time-field input { padding-right: 64px; }
 .mini-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  background: white;
  color: var(--primary);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  z-index: 1;
 }
 .mini-btn:active { transform: translateY(-50%) scale(0.98); }

 #toast-root {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  pointer-events: none;
 }
 .toast {
  pointer-events: none;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
  backdrop-filter: blur(10px);
  max-width: 92vw;
 }

.timeline {
  position: relative;
  padding-left: 20px;
  background-image: repeating-linear-gradient(to bottom, rgba(0,0,0,0.04) 0, rgba(0,0,0,0.04) 1px, transparent 1px, transparent 120px);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  font-size: 13px;
  margin: 6px 8px 0 0;
}

.pill .del-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--accent-red);
  border-radius: 999px;
  width: 24px;
  height: 24px;
  line-height: 22px;
  padding: 0;
  cursor: pointer;
}

.pill .del-btn:active { transform: scale(0.96); }

.mini-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.9);
  color: var(--text-muted);
  font-weight: 800;
}

.quick-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pick-btn {
  border: 1px solid var(--border);
  background: white;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.pick-btn:active { transform: scale(0.98); }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.icon-btn:active { transform: scale(0.98); }

.composer {
  border-top: 1px solid #f3f3f3;
  padding-top: 12px;
}

.mini-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-details { position: relative; }
.mini-details > summary {
  list-style: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.mini-details > summary::-webkit-details-marker { display: none; }
.mini-details[open] > summary { border-color: rgba(0,122,255,0.35); background: rgba(0,122,255,0.06); color: var(--primary); font-weight: 800; }
.mini-details > summary:active { transform: scale(0.98); }
.mini-details > .field, .mini-details > .grid { width: 100%; }
.mini-details[open] { flex: 1 1 100%; }
.mini-details[open] > summary { margin-bottom: 6px; }

.img-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.img-grid img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}
@media (max-width: 560px) {
  .img-grid img { width: 84px; height: 84px; }
}

.project-status-sel {
  display: none;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
}

.review-form { display: none; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.review-form.show { display: flex; }
.review-form input { flex: 1 1 220px; min-width: 0; }
.review-form select { flex: 0 0 auto; }
.review-form button { flex: 0 0 auto; }

.star-rate {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 2px;
  align-items: center;
  user-select: none;
}
.star-rate input { display: none; }
.star-rate label {
  font-size: 16px;
  line-height: 1;
  color: rgba(0,0,0,0.18);
  cursor: pointer;
  padding: 2px 0;
}
.star-rate input:checked ~ label,
.star-rate label:hover,
.star-rate label:hover ~ label {
  color: var(--accent-yellow);
}

.stars {
  color: var(--accent-yellow);
  letter-spacing: 1px;
}

.quick-add-row { flex-wrap: wrap; }
.quick-add-row input { min-width: 0; flex: 1 1 320px; }

@media (max-width: 560px) {
  .filter-bar { overflow-x: auto; flex-wrap: nowrap !important; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  .filter-bar > * { flex: 0 0 auto; }
  .project-filter { overflow-x: visible; flex-wrap: wrap !important; padding-bottom: 0; }
  .project-filter > * { flex: 0 0 auto; }
  .project-filter .status-links { display: none !important; }
  .project-status-sel { display: block !important; }
  .quick-add-row input { flex-basis: 100%; }
  .quick-add-row select { flex: 1 1 140px; }
  .quick-add-row button { flex: 1 1 140px; }
  .quick-add-row button.btn.secondary { padding: 8px 12px; font-size: 13px; }
  details.content-col > summary.flex { flex-wrap: wrap; align-items: flex-start; }
  details.content-col > summary.flex .right { width: 100%; margin-left: 0; text-align: right; }
}

.one-line-form { margin-top: 10px; display: flex; gap: 8px; align-items: center; }
.one-line-input { flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: #fff; min-width: 0; }
.one-line-send { padding: 10px 14px; }
.one-line-record { width: 44px; padding: 10px 0; font-weight: 900; }

@media (max-width: 560px) {
  .one-line-form { flex-wrap: wrap; }
  .one-line-send { flex: 1; }
  .one-line-record { width: 56px; }
}

.fab {
  position: fixed;
  right: 14px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  z-index: 999;
  backdrop-filter: blur(8px);
  display: none;
}
.fab:active { transform: scale(0.98); }
.fab-top { bottom: 74px; }
.fab.show { display: inline-flex; align-items: center; justify-content: center; }
.fab-user { bottom: 130px; }
.fab-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,122,255,0.92);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.6);
  font-size: 11px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

@media (max-width: 720px) {
  .fab { bottom: calc(18px + 56px + env(safe-area-inset-bottom)); }
  .fab-top { bottom: calc(74px + 56px + env(safe-area-inset-bottom)); }
  .fab-user { bottom: calc(130px + 56px + env(safe-area-inset-bottom)); }
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 6px;
  width: 2px;
  background: #E5E5EA;
}
.timeline-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 20px 0 10px 0;
  position: relative;
}

.day-timeline { display: flex; flex-direction: column; gap: 8px; }
.day-grid {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 16px;
  height: calc(1440 * var(--ppm) * 1px);
  background: #fff;
  overflow: hidden;
  margin-bottom: 18px;
}
.multi-grid {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 16px;
  height: calc(var(--range) * var(--ppm) * 1px);
  background: #fff;
  overflow: hidden;
}
.now-line {
  position: absolute;
  left: 56px;
  right: 10px;
  height: 2px;
  background: var(--accent-red);
  z-index: 2;
  opacity: 0.9;
  top: calc(var(--now) * var(--ppm) * 1px);
}
.ongoing.day-event {
  border-color: rgba(52, 199, 89, 0.5);
}
.ongoing.day-event::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  height: 2px;
  background: linear-gradient(90deg, rgba(52,199,89,0.15), rgba(52,199,89,0.85));
  opacity: 0.9;
}
.day-event {
  position: absolute;
  left: 56px;
  right: 10px;
  padding: 10px;
  flex: none;
  box-sizing: border-box;
  top: calc(var(--start) * var(--ppm) * 1px);
  height: max(calc(var(--dur) * var(--ppm) * 1px), 46px);
  min-height: 46px;
  cursor: pointer;
  z-index: 3;
}
.day-event .tl-title { margin-bottom: 2px; }
.day-event .tl-meta { margin-top: 4px; }
.day-event-more { display: none; }
.day-event.expanded {
  height: auto;
  z-index: 30;
  box-shadow: var(--shadow);
}
.day-event.expanded .day-event-more { display: block; }
.list-event.expanded .day-event-more { display: block; }
.timeline-list { display: flex; flex-direction: column; gap: 8px; }
.titem { display: flex; gap: 12px; align-items: flex-start; }
.t-time { width: 54px; flex: none; text-align: right; font-size: 12px; color: var(--text-muted); padding-top: 10px; font-variant-numeric: tabular-nums; }
.list-event { position: relative; padding: 12px; }
.now-marker {
  margin: 10px 0;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(255,59,48,0.35);
  background: rgba(255,59,48,0.06);
  color: var(--accent-red);
  font-weight: 800;
  font-size: 12px;
}
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.lightbox.show { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.3);
}
.uplo-overlay, #uploadOverlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  z-index: 1200;
}
.uplo-box {
  width: min(420px, 92vw);
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}
.uplo-text { font-weight: 800; font-size: 14px; }
.uplo-bar { margin-top: 10px; height: 10px; background: rgba(0,0,0,0.08); border-radius: 999px; overflow: hidden; }
.uplo-bar-fill { height: 100%; width: 0%; background: var(--primary); border-radius: 999px; transition: width 0.12s linear; }
.uplo-pct { margin-top: 8px; font-size: 12px; color: var(--text-muted); font-weight: 800; text-align: right; }

.mv {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  display: none;
  z-index: 1300;
  touch-action: none;
}
.mv.show { display: block; }
.mv-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  gap: 10px;
}
.mv-content {
  width: 100%;
  max-width: 96vw;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mv-content img, .mv-content video {
  max-width: 96vw;
  max-height: 70vh;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
}
.mv-info {
  width: min(820px, 96vw);
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 14px;
  padding: 10px 12px;
}
.mv-title { font-weight: 900; font-size: 14px; color: var(--text); }
.mv-meta { margin-top: 2px; font-size: 12px; color: var(--text-muted); font-weight: 700; }
.mv-desc { margin-top: 6px; font-size: 13px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.mv-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.mv-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.mv-prev { left: 10px; }
.mv-next { right: 10px; }
.media-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}
.record-media {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.record-media .media-file { aspect-ratio: 1; padding: 10px; }
.media-item { position: relative; }
.media-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.06);
  background: #fff;
}
.media-cap {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 10px;
  color: #fff;
  background: rgba(0,0,0,0.45);
  padding: 2px 6px;
  border-radius: 999px;
  max-width: calc(100% - 12px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255,59,48,0.25);
  background: rgba(255,255,255,0.9);
  color: var(--accent-red);
  font-weight: 900;
  cursor: pointer;
}
.media-file {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.06);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  padding: 10px;
}
.timeline-item {
  position: relative;
  display: flex;
  margin-bottom: 20px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -18px; top: 18px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #E5E5EA;
  border: 2px solid white;
  z-index: 2;
}
.timeline-item.ongoing::before {
  background: var(--accent-green);
  box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.2);
}
.time-col {
  width: 60px;
  flex-shrink: 0;
  text-align: right;
  padding-right: 15px;
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 14px;
}
.content-col {
  flex: 1;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.2s;
  background: white;
  overflow: hidden;
  min-height: var(--h, 64px);
}
.content-col::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--fill, 0%);
  background: rgba(0,122,255,0.10);
}
.content-col > * { position: relative; z-index: 1; }

.event-c0 .content-col::before, .event-c0.content-col::before { background: rgba(0,122,255,0.12); }
.event-c1 .content-col::before, .event-c1.content-col::before { background: rgba(255,149,0,0.12); }
.event-c2 .content-col::before, .event-c2.content-col::before { background: rgba(255,59,48,0.12); }
.event-c3 .content-col::before, .event-c3.content-col::before { background: rgba(52,199,89,0.12); }
.timeline-item.ongoing .content-col {
  border-color: var(--accent-green);
  background: #F0FFF4;
}
.timeline-item.ongoing .content-col::before { background: rgba(52,199,89,0.16); }
.timeline-item.ongoing .content-col::after {
  content: '进行中';
  position: absolute;
  top: 10px; right: 10px;
  font-size: 10px;
  color: var(--accent-green);
  font-weight: bold;
  background: rgba(52, 199, 89, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}
.ongoing.content-col { border-color: var(--accent-green); background: #F0FFF4; }
.ongoing.content-col::before { background: rgba(52,199,89,0.16); }
.tl-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.tl-desc { font-size: 13px; color: #666; margin-bottom: 8px; white-space: pre-wrap; }
.tl-meta { font-size: 12px; color: #999; }
.tl-pic { width: 100%; max-height: 160px; object-fit: cover; border-radius: 8px; }

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90vh;
  background: linear-gradient(135deg, #F5F7FA 0%, #C3CFE2 100%);
}
.login-box {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
  .search-center { margin: 15px 0; }
  .clock-time { font-size: 42px; }
  .grid-2 { grid-template-columns: 1fr; }
  .nav { justify-content: flex-start; padding-bottom: 10px; }
  .card { padding: 20px; border-radius: 16px; }
  .clock-widget { padding: 20px; border-radius: 16px; }
  .dash-team { order: 1; }
  .dash-record { order: 2; }
  .dash-search { order: 3; }
  .dash-grid { order: 2; }
  
  .timeline { padding-left: 10px; }
  .timeline::before { left: 4px; }
  .timeline-item::before { left: -10px; }
  .time-col { width: 45px; padding-right: 10px; font-size: 12px; }
  .hour-label { left: 8px; font-size: 10px; }
  .day-event { left: 50px; right: 8px; padding: 9px; }
  .now-line { left: 50px; right: 8px; }
}

.cal-day {
  position: relative;
  background: white;
  border-radius: 12px;
  padding: 6px;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  border: 1px solid transparent;
  overflow: hidden;
  transition: transform 0.1s, background-color 0.2s;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.cal-day:active { transform: scale(0.96); }

.cal-day-num {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  z-index: 2;
}

.cal-badges {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1px;
  max-width: 60%;
  z-index: 2;
  pointer-events: none;
}
.cal-badges span {
  font-size: 10px;
  line-height: 1;
}

.cal-mood {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  z-index: 2;
  margin-top: auto;
  opacity: 0.8;
}

.cal-day.cal-out { opacity: 0.3; background: #FAFAFA; box-shadow: none; }
.cal-day.cal-today { background: #FAFAFA; border-color: rgba(0,0,0,0.08); font-weight: 800; }
.cal-day.cal-today .cal-day-num { color: var(--primary); }

.cal-day.cal-sex {
  box-shadow: inset 0 0 0 1px rgba(255,45,85,0.25);
}
.cal-day.cal-pending {
  box-shadow: inset 0 0 0 1px rgba(255,149,0,0.45);
  background: rgba(255,149,0,0.03);
}

.cal-day.cal-sel {
  box-shadow: inset 0 0 0 2px var(--primary), 0 4px 12px rgba(0,122,255,0.15) !important;
  background: white !important;
  z-index: 10;
  transform: translateY(-1px);
}

.cal-day.cal-bleed {
  background: #FFF0F0;
  border-color: transparent;
  box-shadow: none;
}
.cal-day.cal-bleed .cal-day-num { color: #C62828; }
.cal-day.cal-bleed .cal-mood { color: #EF9A9A; }

/* 预测开始日 */
.cal-day.cal-pred {
  background: #FFF3E0;
  border: 1px dashed #FFB74D;
}
.cal-day.cal-pred .cal-day-num { color: #EF6C00; }

/* 预测区间 */
.cal-day.cal-pred-win {
  background: #FFF8E1;
  border-color: transparent;
  box-shadow: none;
}
