@import '../../shared/tokens.css';

/* ===== 日系简约风�?===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-round);
  background: var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.8;
  font-size: 18px;
  font-weight: 400;
}

.hidden { display: none !important; }

/* 手绘不规则线条滤�?*/
.sketchy {
  filter: url(#sketchy-filter);
}

/* ===== 主应用布局 ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--bg-card);
  border-bottom: var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.app-logo {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--pink);
  letter-spacing: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-username {
  font-size: 0.95rem;
  color: var(--ink-light);
  font-weight: 500;
}

.app-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px;
}

/* ===== 视图切换 ===== */
.view { display: none; }
.view.active { display: block; }

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 14px;
}

.view-header h2 {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 500;
  color: var(--pink);
}

.view-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-input,
.date-input {
  padding: 10px 18px;
  border: var(--border);
  border-radius: 25px;
  font-family: var(--font-round);
  font-size: 1rem;
  background: var(--bg-card);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.search-input:focus,
.date-input:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 2px 8px rgba(126, 155, 179, 0.2);
}

/* ===== 日历 ===== */
.calendar-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: var(--border);
  margin-bottom: 28px;
  box-shadow: var(--shadow-pink);
  position: relative;
  overflow: hidden;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.calendar-header h2 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--blue);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-weekday {
  text-align: center;
  padding: 10px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-light);
  background: var(--pink-light);
  border-radius: var(--radius-sm);
}

.cal-day {
  text-align: center;
  padding: 12px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  font-weight: 500;
  background: var(--bg);
}

.cal-day:hover {
  background: var(--yellow-light);
  border-color: var(--yellow);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cal-day.today {
  background: var(--blue);
  color: white;
  border-radius: 50%;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.cal-day.selected {
  background: var(--pink-light);
  border: 1.5px solid var(--pink);
}

.cal-day.other-month {
  color: var(--ink-ghost);
  background: transparent;
}

.cal-day .cal-dots {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.cal-day .cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink);
}

.cal-dot.schedule-dot { background: var(--pink); }

/* ===== 日期详情 ===== */
.day-detail {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: var(--border);
  box-shadow: var(--shadow-blue);
  position: relative;
}

.day-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 14px;
}

.day-detail-header h3 {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--blue);
}

.day-detail-actions {
  display: flex;
  gap: 10px;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h4 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  color: var(--pink);
  font-weight: 500;
  border-bottom: 1px dashed var(--pink-light);
  padding-bottom: 8px;
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--ink-ghost);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.detail-item:hover {
  border-color: var(--pink);
  background: var(--pink-light);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(126, 155, 179, 0.15);
}

.detail-item.completed .detail-item-title {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  color: var(--ink-faint);
  animation: strikethrough 0.4s ease-out;
}

@keyframes strikethrough {
  0% {
    text-decoration-color: transparent;
    opacity: 1;
  }
  50% {
    text-decoration-color: var(--pink);
    opacity: 0.8;
  }
  100% {
    text-decoration-color: var(--ink-faint);
    opacity: 0.6;
  }
}

.detail-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.item-number {
  font-weight: 500;
  color: var(--blue);
  font-size: 1.1rem;
  min-width: 28px;
  text-align: right;
  background: var(--blue-light);
  padding: 4px 8px;
  border-radius: 50%;
}

.detail-item-title {
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--ink);
}

.detail-item-meta {
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-top: 4px;
}

.detail-empty {
  color: var(--ink-faint);
  font-style: italic;
  padding: 24px;
  text-align: center;
  font-size: 1.1rem;
}

/* ===== 七格周视�?===== */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}

.week-column {
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--ink-ghost);
  padding: 12px;
  height: 300px;
  display: flex;
  flex-direction: column;
}

.week-header {
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--pink);
  text-align: center;
  padding: 8px;
  border-bottom: 1px dashed var(--pink-light);
  margin-bottom: 12px;
  line-height: 1.4;
}

.week-header-date {
  font-size: 0.95rem;
}

.week-schedules {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.week-add-placeholder {
  text-align: center;
  padding: 12px 8px;
  color: var(--ink-faint);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s;
  margin-top: auto;
}

.week-add-placeholder:hover {
  color: var(--pink);
}

.week-schedule-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink-ghost);
  padding: 8px;
  font-size: 0.9rem;
  transition: all 0.2s;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.week-schedule-item .week-schedule-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  color: var(--ink-faint);
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  padding: 0;
  line-height: 1;
}

.week-schedule-item:hover .week-schedule-delete {
  opacity: 1;
}

.week-schedule-item .week-schedule-delete:hover {
  color: var(--pink);
}

.week-schedule-item:hover {
  border-color: var(--pink);
  background: var(--pink-light);
  transform: translateX(2px);
}

.week-schedule-item.completed {
  opacity: 0.5;
}

.week-schedule-item.completed .week-schedule-title {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  color: var(--ink-faint);
  animation: strikethrough 0.4s ease-out;
}

.week-schedule-title {
  font-weight: 500;
  color: var(--ink);
}

/* ===== 任务菜单 ===== */
.task-menu {
  background: var(--bg-card);
  border: 1px solid var(--ink-ghost);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 120px;
  overflow: hidden;
}

.task-menu-item {
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
  color: var(--ink);
  border-bottom: 1px solid var(--ink-ghost);
}

.task-menu-item:last-child {
  border-bottom: none;
}

.task-menu-item:hover {
  background: var(--pink-light);
  color: var(--pink);
}

/* ===== 卡片列表 ===== */
.card-list {
  display: grid;
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: var(--border);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  box-shadow: var(--shadow-yellow);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--pink);
}

.card-date {
  font-size: 0.9rem;
  color: var(--ink-light);
  background: var(--purple-light);
  padding: 4px 14px;
  border-radius: 20px;
}

.card-body {
  color: var(--ink-light);
  font-size: 1rem;
  line-height: 1.7;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.card-tag {
  display: inline-block;
  padding: 4px 14px;
  background: var(--green-light);
  border: 1px solid var(--green);
  border-radius: 15px;
  font-size: 0.85rem;
  color: var(--ink);
  font-weight: 500;
}

.card-mood {
  font-size: 1.4rem;
}

/* ===== 日程卡片 ===== */
.schedule-card {
  border-left: 4px solid var(--pink);
}

.schedule-card.completed {
  opacity: 0.5;
}

.schedule-card.completed .card-title {
  text-decoration: line-through;
  text-decoration-style: wavy;
}

.schedule-time {
  font-size: 0.9rem;
  color: var(--blue);
  font-weight: 500;
  background: var(--blue-light);
  padding: 4px 12px;
  border-radius: 15px;
}

.toggle-complete {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--pink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: var(--bg-card);
  flex-shrink: 0;
  font-weight: 500;
  font-size: 1rem;
}

.toggle-complete:hover {
  background: var(--pink-light);
  transform: scale(1.1);
}

.toggle-complete.checked {
  background: var(--pink);
  color: white;
  font-size: 1.1rem;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border: 1px solid var(--ink-ghost);
  border-radius: 25px;
  font-family: var(--font-round);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  background: var(--bg-card);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(126, 155, 179, 0.18);
  background: var(--pink-light);
  border-color: var(--pink);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.btn-primary {
  background: var(--pink);
  color: white;
  border-color: var(--pink);
}

.btn-primary:hover {
  background: var(--pink-light);
  color: var(--pink);
  border-color: var(--pink);
}

.btn-accent {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.btn-accent:hover {
  background: var(--blue-light);
  color: var(--blue);
  border-color: var(--blue);
}

.btn-danger {
  background: var(--purple);
  color: white;
  border-color: var(--purple);
}

.btn-danger:hover {
  background: var(--purple-light);
  color: var(--purple);
  border-color: var(--purple);
}

.btn-text {
  background: transparent;
  border-color: transparent;
  color: var(--ink-light);
  box-shadow: none;
}

.btn-text:hover {
  color: var(--ink);
  background: var(--yellow-light);
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--ink-ghost);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--ink);
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn-icon:hover {
  background: var(--yellow-light);
  border-color: var(--yellow);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.btn-block { width: 100%; }

.btn-small {
  padding: 8px 18px;
  font-size: 0.95rem;
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 1.1rem;
  color: var(--pink);
  font-weight: 500;
}

.form-group label small {
  font-weight: 400;
  color: var(--ink-faint);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--ink-ghost);
  border-radius: var(--radius-sm);
  font-family: var(--font-round);
  font-size: 18px;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg-card);
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 2px 8px rgba(126, 155, 179, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 28px;
}

/* ===== 星期选择 ===== */
.weekday-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.weekday-option {
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  border: 1px solid var(--ink-ghost);
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s;
  background: var(--bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.weekday-option:hover {
  background: var(--blue-light);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(126, 155, 179, 0.18);
}

.weekday-option.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

/* ===== 模态框 ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(250, 250, 250, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  border: var(--border);
  box-shadow: var(--shadow-pink);
}

.modal-large {
  max-width: 750px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.modal-header h3 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--pink);
}

.modal-close {
  background: var(--pink-light);
  border: 1px solid var(--pink);
  font-size: 1.3rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--pink);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--pink);
  color: white;
  transform: scale(1.1);
}

/* ===== 日记详情 ===== */
.diary-view-body {
  margin-bottom: 28px;
}

.diary-view-meta {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  color: var(--ink-light);
  font-size: 1rem;
}

.diary-view-content {
  line-height: 1.9;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  padding: 20px;
  border: 1px dashed var(--pink-light);
  border-radius: var(--radius);
  background: var(--bg);
}

/* ===== 空状�?===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-faint);
}

.empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 1.2rem;
}

/* ===== 响应�?===== */
@media (max-width: 768px) {
  .app-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 20px;
  }

  .app-logo { font-size: 1.4rem; }

  .app-content { padding: 20px; }

  .view-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .view-header h2 { font-size: 1.6rem; }

  .view-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .search-input, .date-input { flex: 1; }

  .form-row { grid-template-columns: 1fr; }

  .modal-content { padding: 24px; }

  .calendar-container { padding: 20px; }

  .cal-day { padding: 8px 2px; min-height: 44px; font-size: 0.95rem; }

  .day-detail-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .card { padding: 20px; }
  .btn { padding: 8px 18px; font-size: 0.95rem; }
  .header-username { display: none; }
}

/* ===== 动画 ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.card { animation: fadeIn 0.3s ease; }
.modal-content { animation: fadeIn 0.2s ease; }

.cal-day:hover {
  animation: bounce 0.5s ease;
}
