﻿* { margin: 0; padding: 0; box-sizing: border-box }
:root {
 --bg: #f5f5f5;
 --card: #fff;
 --text: #333;
 --text2: #888;
 --border: #e0e0e0;
 --primary: #4A90D9; --primary-dark: #357ABD;
 --primary-light: #e8f0fe;
 --danger: #e74c3c;
 --success: #27ae60;
 --warning: #f39c12;
 --urgent: #e74c3c;
 --very-urgent: #c0392b;
}
body {
 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
 background: var(--bg);
 color: var(--text);
 min-height: 100vh;
}
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; background: linear-gradient(135deg, #1a3a6b 0%, #2c6aa0 40%, #4A90D9 100%) }
.auth-icon { font-size: 40px; text-align: center; margin-bottom: 4px }
.auth-box { background: #ffffff; padding: 36px 32px; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.18); width: 100%; max-width: 380px }
.auth-box h1 { font-size: 22px; font-weight: 700; text-align: center; color: var(--primary); }
.auth-box p { color: var(--text2); font-size: 14px; margin-bottom: 24px; text-align: center }
.form-group { margin-bottom: 16px }
.form-group label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 4px }
.form-group input, .form-group select {
 width: 100%; padding: 10px 12px; border: 1px solid var(--border);
 border-radius: 8px; font-size: 15px; outline: none;
}
.form-group input:focus { border- }
.form-checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text2); margin-bottom: 16px }
.btn {
 width: 100%; padding: 12px; border: none; border-radius: 8px;
 font-size: 15px; cursor: pointer; font-weight: 600;
}
.btn-primary { background: var(--primary); color: #fff }
.btn-primary:hover { opacity: 0.9 }
.btn-small { padding: 6px 12px; font-size: 13px; width: auto }
.btn-danger { background: var(--danger); color: #fff }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text) }
.btn-sm { padding: 4px 10px; font-size: 12px; width: auto; border-radius: 6px }
.btn-icon { width: auto; display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; font-size: 12px; border-radius: 6px }
.auth-link { text-align: center; font-size: 14px; margin-top: 16px }
.auth-link span { cursor: pointer }
.auth-link span:hover { text-decoration: underline }
.error-msg { color: var(--danger); font-size: 13px; margin-bottom: 12px }

.app { display: none; max-width: 800px; margin: 0 auto; padding: 12px }
.app-header {
 display: flex; align-items: center; justify-content: space-between;
 padding: 12px 0; margin-bottom: 12px;
}
.app-header h1 { font-size: 20px }
.user-info { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text2) }
.user-info span { cursor: pointer; color: var(--danger) }

.tabs { display: flex; gap: 0; margin-bottom: 16px; background: var(--card); border-radius: 10px; overflow: hidden }
.tab { flex: 1; padding: 10px; text-align: center; cursor: pointer; font-size: 14px; border: none; background: transparent }
.tab.active { background: var(--primary); color: #fff; font-weight: 600 }

.add-task { background: var(--card); border-radius: 12px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.04) }
.add-task textarea {
 width: 100%; border: 1px solid var(--border); border-radius: 8px;
 padding: 10px; font-size: 15px; resize: vertical; min-height: 44px;
 font-family: inherit; outline: none;
}
.add-task textarea:focus { border- }
.add-task-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center }
.add-task-row input, .add-task-row select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px }
.add-task-row .btn { width: auto }

.voice-btn {
 padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
 background: var(--card); cursor: pointer; font-size: 13px;
}
.voice-btn.listening { background: var(--danger); color: #fff; border-color: var(--danger) }

.task-list { display: flex; flex-direction: column; gap: 8px }
.task-item {
 background: var(--card); border-radius: 10px; padding: 14px 16px;
 box-shadow: 0 1px 4px rgba(0,0,0,0.04); cursor: pointer;
}
.task-item.completed { opacity: 0.6 }
.task-item.completed .task-content { text-decoration: line-through; color: var(--text2) }
.task-top { display: flex; align-items: flex-start; gap: 10px }
.task-check { width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 50%; margin-top: 2px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center }
.task-check.done { background: var(--success); border-color: var(--success); color: #fff; font-size: 12px }
.task-body { flex: 1; min-width: 0 }
.task-content { font-size: 15px; line-height: 1.4 }
.task-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px }
.task-row { display: flex; align-items: baseline; gap: 6px; margin-top: 3px; font-size: 12px; line-height: 1.4; }
.task-row:first-child { margin-top: 0; }
.row-label { color: #9ca3af; font-size: 11px; min-width: 28px; flex-shrink: 0; }
.row-value { color: var(--text); flex: 1; min-width: 0; }
.task-row-main .row-value { font-weight: 600; color: var(--text); font-size: 14px; }
.task-row.header-row { font-size: 11px; color: var(--text2); border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 6px; }
.task-row.header-row .row-label { font-size: 11px; color: var(--text2); }
.task-row.header-row .row-value { display: flex; justify-content: space-between; }
.task-row.header-row .row-value span { text-align: center; flex: 1; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600 }
.badge-urgent { background: #fde8e8; color: var(--urgent) }
.badge-very-urgent { background: #fde8e8; color: var(--very-urgent); font-weight: 700 }
.badge-deadline { background: var(--primary-light) }
.badge-date { background: #e8f5e9; color: #2e7d32 }
.badge-pending { background: #fff3e0; color: #e65100 }
.task-actions { display: flex; gap: 4px; margin-top: 6px }
.task-actions button { font-size: 12px; padding: 3px 8px; border: none; border-radius: 4px; cursor: pointer }
.task-delete { background: #fde8e8; color: var(--danger) }
.task-progress-btn { background: var(--primary-light) }

.progress-section { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border) }
.progress-section textarea { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 8px; font-size: 13px; resize: vertical; min-height: 36px; font-family: inherit }
.progress-actions { display: flex; gap: 6px; margin-top: 6px }
.progress-log { font-size: 13px; color: var(--text2); margin-top: 6px }
.progress-log-item { padding: 6px 0; border-bottom: 1px solid #f0f0f0 }
.progress-log-item:last-child { border-bottom: none }
.progress-log-item .time { font-size: 11px; color: #aaa }
.progress-log-item .text { margin-top: 2px }

.calendar-view { background: var(--card); border-radius: 12px; overflow: hidden }
.calendar-header { display: flex; align-items: center; justify-content: space-between; padding: 16px }
.calendar-nav { display: flex; gap: 12px; align-items: center }
.calendar-nav button { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 14px }
.calendar-nav .month-label { font-size: 16px; font-weight: 600; min-width: 140px; text-align: center }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr) }
.calendar-day-header { text-align: center; font-size: 12px; color: var(--text2); padding: 8px 0; font-weight: 600 }
.calendar-day { min-height: 80px; padding: 4px; border: 1px solid #f0f0f0; font-size: 13px }
.calendar-day.other-month { color: #ddd }
.calendar-day.today { background: var(--primary-light) }
.calendar-day .day-num { padding: 2px 6px; font-weight: 600 }
.calendar-day.today .day-num { background: var(--primary); color: #fff; border-radius: 50%; display: inline-block; width: 24px; height: 24px; text-align: center; line-height: 24px }
.calendar-event { font-size: 11px; padding: 1px 4px; margin: 1px 0; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer }
.calendar-event.event { background: #e3f2fd; color: #1565c0 }
.calendar-event.deadline { background: #fce4ec; color: #c62828 }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text2); font-size: 14px }

/* ========== 5列表格布局 ========== */
.task-row-data {
  display: flex;
  align-items: center;
  background: var(--card);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 4px;
  border: 1px solid var(--border);
  gap: 8px;
}
.task-row-data.completed { opacity: 0.5; }
.task-row-data.completed .col { color: var(--text2); }
.task-row-data .col {
  font-size: 12px;
  min-width: 0;
  color: var(--text);
}
.task-row-data .col:nth-child(1) {
  min-width: 45px;
  max-width: 65px;
  white-space: nowrap;
}
.task-row-data .col:nth-child(2) {
  min-width: 60px;
  flex: 2;
  white-space: normal;
  word-break: break-word;
}
.task-row-data .col:nth-child(3) {
  min-width: 50px;
  flex: 1.5;
  white-space: normal;
  word-break: break-word;
}
.task-row-data .col:nth-child(4) {
  min-width: 65px;
  max-width: 110px;
  white-space: nowrap;
}
.task-row-data .col:nth-child(5) {
  min-width: 30px;
  max-width: 70px;
  white-space: nowrap;
}

/* 固定的5列标题行 */
.fixed-header-row {
  display: flex;
  background: var(--card);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text2);
  font-weight: 600;
  gap: 8px;
}
.fixed-header-row .col {
  font-size: 11px;
  text-align: left;
  min-width: 0;
}
.fixed-header-row .col:nth-child(1) { min-width: 45px; max-width: 65px; }
.fixed-header-row .col:nth-child(2) { min-width: 60px; flex: 2; }
.fixed-header-row .col:nth-child(3) { min-width: 50px; flex: 1.5; }
.fixed-header-row .col:nth-child(4) { min-width: 65px; max-width: 110px; }
.fixed-header-row .col:nth-child(5) { min-width: 30px; max-width: 70px; }
.fixed-header-row .col-del { margin-left: auto; margin-right: 4px; width: 28px; flex-shrink: 0; }

/* ✕ 删除按钮（透明背景，融入白卡） */
.task-delete {
  margin-left: auto;
  margin-right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}
.task-delete:hover { color: var(--danger); }

/* 手机端适配：让✕始终在白卡内 */
@media (max-width: 600px) {
  .task-row-data {
    padding: 8px 10px;
    gap: 4px;
  }
  .task-row-data .col {
    font-size: 11px;
  }
  .task-row-data .col:nth-child(1) {
    min-width: 32px;
    max-width: 38px;
  }
  .task-row-data .col:nth-child(4) {
    min-width: 55px;
    max-width: 75px;
  }
  .task-row-data .col:nth-child(5) {
    min-width: 24px;
    max-width: 36px;
  }
  .task-delete {
    width: 16px;
    height: 16px;
    font-size: 11px;
    margin-left: 4px;
    margin-right: 0;
  }
  .fixed-header-row {
    padding: 8px 10px;
    gap: 4px;
    font-size: 10px;
  }
  .fixed-header-row .col:nth-child(1) {
    min-width: 32px;
    max-width: 38px;
  }
  .fixed-header-row .col:nth-child(4) {
    min-width: 55px;
    max-width: 75px;
  }
  .fixed-header-row .col:nth-child(5) {
    min-width: 24px;
    max-width: 36px;
  }
  .fixed-header-row .col-del {
    width: 20px;
  }
}

@media (max-width: 600px) {
 .app { padding: 8px }
 .add-task-row { flex-direction: column; align-items: stretch }
 .add-task-row input, .add-task-row select { width: 100% }
 .calendar-day { min-height: 60px; font-size: 11px }
}

/* fixed header container - sticky at top */
.fixed-header-container {
  position: sticky;
  top: 0;
  z-index: 10;
  margin-bottom: 6px;
}
.fixed-header-container .fixed-header-row {
  margin-bottom: 0;
}
