:root {
  --bg: #f6f5f2;
  --panel: #ffffff;
  --border: #e4e1da;
  --text: #262420;
  --text-dim: #8a8578;
  --accent: #4f46e5;
  --danger: #c0392b;
  --done-bg: #f0f4ef;
  --overdue: #c0392b;
  font-family: -apple-system, "PingFang TC", "Noto Sans TC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

#app {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 10px;
}

.sidebar-header h1 {
  font-size: 16px;
  margin: 0;
}

.icon-btn {
  border: none;
  background: var(--accent);
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.group-list {
  overflow-y: auto;
  padding: 4px 8px;
}

.group-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 2px;
}

.group-item:hover { background: #f1efe9; }
.group-item.active { background: #ece9ff; font-weight: 600; }

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* Main */
.main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.empty-state, .placeholder {
  color: var(--text-dim);
  text-align: center;
  margin-top: 80px;
}

.hidden { display: none !important; }

.group-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.group-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.group-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-title h2 { margin: 0; font-size: 20px; }

.header-actions { display: flex; gap: 8px; }

.btn-primary, .btn-secondary, .btn-danger {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.btn-primary { background: var(--accent); color: white; }
.btn-secondary { background: #eeece6; color: var(--text); }
.btn-danger { background: var(--danger); color: white; }

.content-split {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.meeting-list {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 10px;
}

.meeting-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 4px;
}

.meeting-item:hover { background: #f1efe9; }
.meeting-item.active { background: #ece9ff; }

.meeting-item .m-date { font-size: 12px; color: var(--text-dim); }
.meeting-item .m-title { font-size: 14px; font-weight: 500; margin-top: 2px; }

.meeting-detail {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
}

.detail-header input[type="text"] {
  font-size: 18px;
  font-weight: 600;
  border: none;
  background: transparent;
  width: 100%;
  padding: 4px 0;
}

.detail-header input[type="date"] {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
}

textarea#meetingNotes {
  width: 100%;
  min-height: 90px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 20px;
}

.todos-section h3 {
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text-dim);
}

.todo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--panel);
}

.todo-row.done { background: var(--done-bg); opacity: 0.75; }
.todo-row.done .todo-content { text-decoration: line-through; }

.todo-content {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  padding: 4px;
}

.todo-owner, .todo-due {
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  padding: 4px 6px;
  width: 90px;
}

.todo-tag {
  font-size: 11px;
  border-radius: 5px;
  padding: 4px 6px;
  border: 1px solid var(--border);
}

.tag-重要 { color: var(--danger); border-color: var(--danger); }

.carry-badge {
  font-size: 11px;
  background: #fdf0e3;
  color: #b5651d;
  border-radius: 10px;
  padding: 2px 8px;
  white-space: nowrap;
}

.overdue-badge {
  font-size: 11px;
  color: var(--overdue);
  white-space: nowrap;
}

.todo-del {
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
}

.add-todo-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.add-todo-row input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}

.detail-footer {
  margin-top: 24px;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-box {
  background: var(--panel);
  border-radius: 12px;
  padding: 20px;
  width: 320px;
}

.modal-box h3 { margin-top: 0; }

.modal-box input[type="text"], .modal-box input[type="color"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.stats-bar {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

/* Recording */
.recording-section {
  margin-bottom: 22px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfaf7;
}

.recording-section h3 {
  font-size: 14px;
  margin: 0 0 10px;
  color: var(--text-dim);
}

.recording-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.record-status {
  font-size: 12px;
  color: var(--danger);
}

#meetingTranscript {
  width: 100%;
  min-height: 110px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 8px;
  background: white;
}
