:root {
  --primary: #4f6df5;
  --primary-dark: #3b54d4;
  --danger: #ff4d4f;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-gray: #999;
  --border: #ececec;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --radius: 12px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(79, 109, 245, 0.3);
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 16px 80px;
}

/* 环境提示横幅 */
.env-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fff8e6;
  border: 1px solid #ffe58f;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #8a5a00;
}
.env-banner.hidden { display: none; }
.env-icon { flex-shrink: 0; margin-top: 1px; }
.env-text { flex: 1; }
.env-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #8a5a00;
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  opacity: 0.6;
}
.env-close:hover { opacity: 1; }

/* 语音录入 */
.voice-section {
  text-align: center;
  padding: 24px 0 18px;
}

.voice-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(79, 109, 245, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
}

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

.voice-btn.recording {
  background: var(--danger);
  box-shadow: 0 6px 18px rgba(255, 77, 79, 0.5);
  animation: pulse 1.4s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 6px 18px rgba(255, 77, 79, 0.5), 0 0 0 0 rgba(255, 77, 79, 0.5); }
  70% { box-shadow: 0 6px 18px rgba(255, 77, 79, 0.5), 0 0 0 24px rgba(255, 77, 79, 0); }
  100% { box-shadow: 0 6px 18px rgba(255, 77, 79, 0.5), 0 0 0 0 rgba(255, 77, 79, 0); }
}

.mic-icon {
  font-size: 36px;
  line-height: 1;
}

.voice-text {
  margin-top: 6px;
  font-size: 14px;
}

.voice-hint {
  margin: 14px auto 0;
  font-size: 13px;
  color: var(--text-gray);
  max-width: 320px;
}

/* 手动添加 */
.add-section {
  text-align: center;
  margin-bottom: 16px;
}

.add-btn {
  background: #fff;
  border: 1px dashed var(--primary);
  color: var(--primary);
  padding: 10px 22px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.add-btn:hover {
  background: #eef1ff;
}

/* 提醒横幅 */
.remind-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: linear-gradient(135deg, #ff6b6b, #ff4d4f);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.banner-text {
  font-size: 15px;
  font-weight: 600;
}

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

.banner-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.banner-btn.primary {
  background: #fff;
  color: var(--danger);
}

/* 列表 */
.section-title {
  font-size: 14px;
  color: var(--text-gray);
  margin: 8px 4px 10px;
  font-weight: 500;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  transition: transform 0.15s;
}

.item-card.reminded {
  border-left-color: var(--danger);
}

.item-card.done {
  border-left-color: var(--text-gray);
  opacity: 0.7;
}

.item-main {
  flex: 1;
  min-width: 0;
}

.item-time {
  font-size: 13px;
  color: var(--text-gray);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-card.done .item-time,
.item-card.done .item-content {
  color: var(--text-gray);
  text-decoration: line-through;
}

.item-card.reminded .item-time,
.item-card.reminded .item-content {
  color: var(--text-gray);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

.item-content {
  font-size: 16px;
  font-weight: 500;
  word-break: break-word;
}

.item-actions {
  display: flex;
  gap: 6px;
  margin-left: 10px;
}

.act-btn {
  background: #f0f2ff;
  border: none;
  color: var(--primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.act-btn.del {
  background: #ffecec;
  color: var(--danger);
}

.empty-tip {
  text-align: center;
  color: var(--text-gray);
  font-size: 14px;
  padding: 30px 0;
}

/* 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.hidden,
.remind-banner.hidden,
.hidden {
  display: none !important;
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.modal-title {
  margin: 0 0 16px;
  font-size: 17px;
  text-align: center;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-gray);
  margin-bottom: 6px;
}

.content-input,
.time-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}

.content-input {
  resize: vertical;
}

.content-input:focus,
.time-input:focus {
  outline: none;
  border-color: var(--primary);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-btn {
  flex: 1;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  background: #f0f2f5;
  color: var(--text);
}

.modal-btn.primary {
  background: var(--primary);
  color: #fff;
}
