* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f4f8;
  color: #1a1a2e;
  min-height: 100vh;
}

/* 顶部栏 */
.topbar {
  background: #1f4e9c;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .title { font-size: 17px; font-weight: 600; }
.topbar .user { font-size: 13px; opacity: 0.9; display: flex; align-items: center; gap: 10px; }
.topbar a { color: #fff; text-decoration: none; font-size: 13px; opacity: 0.9; }
.topbar a:hover { opacity: 1; }

.container { max-width: 720px; margin: 0 auto; padding: 16px; }

/* 卡片 */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border-left: 4px solid #1f4e9c;
}
.card.expired { border-left-color: #999; opacity: 0.55; }
.card.done { border-left-color: #27ae60; }
.card.pinned { border-left-color: #f39c12; box-shadow: 0 1px 6px rgba(243,156,18,0.25); }

.card .card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card .card-title { font-size: 16px; font-weight: 600; line-height: 1.4; }
.card .card-content { font-size: 14px; color: #444; margin-top: 8px; line-height: 1.6; white-space: pre-wrap; }
.card .meta { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.badge.deadline { background: #fff1e6; color: #d35400; }
.badge.urgent { background: #ffe6e6; color: #c0392b; }
.badge.done { background: #e6f7ee; color: #27ae60; }
.badge.expired { background: #eee; color: #666; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  transition: 0.15s;
}
.btn-primary { background: #1f4e9c; color: #fff; }
.btn-primary:hover { background: #17407f; }
.btn-success { background: #27ae60; color: #fff; }
.btn-danger { background: #fff; color: #c0392b; border: 1px solid #c0392b; }
.btn-pinned { background: #1f4e9c; color: #fff; }
.btn-pinned:hover { background: #17407f; }
.btn-ghost { background: #eef1f6; color: #333; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 5px 12px; font-size: 13px; }

/* 勾选框按钮（大） */
.check-btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 2px solid #d0d5dd;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
  color: #555;
}
.check-btn.checked {
  border-color: #27ae60;
  background: #e6f7ee;
  color: #27ae60;
}

/* 登录页 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f4e9c, #3a7bd5);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 30px 26px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 6px; }
.login-card .sub { text-align: center; color: #888; font-size: 13px; margin-bottom: 22px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: #1f4e9c; }

/* 表格 */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
th, td { padding: 10px 12px; text-align: center; font-size: 13px; border-bottom: 1px solid #eef1f6; }
th { background: #f7f9fc; color: #555; font-weight: 600; white-space: nowrap; }
td.left { text-align: left; }
.cell-done { color: #27ae60; font-weight: 600; }
.cell-read { color: #b7791f; font-weight: 600; }
.cell-todo { color: #ccc; }
.table-scroll { overflow-x: auto; }

/* 复选框多选 */
.checkbox-list { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-list label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.checkbox-list label.on { background: #e6f0ff; border-color: #1f4e9c; color: #1f4e9c; }

.section-title { font-size: 15px; font-weight: 600; margin: 20px 0 10px; display: flex; align-items: center; gap: 8px; }
.hint { font-size: 12px; color: #999; margin-top: 6px; }
.error-msg { color: #c0392b; font-size: 13px; margin-top: 10px; text-align: center; }

/* 标签页 */
.tabs { display: flex; gap: 0; background: #fff; border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.tabs button {
  flex: 1;
  padding: 12px;
  border: none;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  color: #666;
  border-bottom: 2px solid transparent;
}
.tabs button.active { color: #1f4e9c; border-bottom-color: #1f4e9c; font-weight: 600; }

.empty { text-align: center; color: #aaa; padding: 40px 0; font-size: 14px; }

/* 图片上传与展示 */
.upload-zone {
  border: 2px dashed #c0c7d4;
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  color: #888;
  cursor: pointer;
  font-size: 14px;
  transition: 0.15s;
}
.upload-zone:hover { border-color: #1f4e9c; color: #1f4e9c; }

.thumb-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb-wrap { position: relative; width: 84px; height: 84px; }
.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid #e0e4ea; }
.thumb-wrap .del {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #c0392b; color: #fff; border: none;
  font-size: 12px; line-height: 22px; text-align: center; cursor: pointer;
}

.policy-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.policy-images img {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: 8px; border: 1px solid #e0e4ea; cursor: zoom-in;
}

/* 图片放大遮罩 */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; cursor: zoom-out;
}
.lightbox img { max-width: 94vw; max-height: 94vh; border-radius: 6px; }

/* 模态框 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 200;
  padding: 20px;
}
.modal {
  background: #fff; border-radius: 14px; padding: 24px 22px;
  width: 100%; max-width: 360px;
}
.modal h3 { font-size: 17px; margin-bottom: 16px; }
.modal .btn-row { display: flex; gap: 10px; margin-top: 8px; }
.modal .btn-row .btn { flex: 1; justify-content: center; }
.modal .err { color: #c0392b; font-size: 13px; margin-top: 10px; text-align: center; min-height: 18px; }

/* 记住账号 */
.remember-row { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #666; margin-bottom: 16px; cursor: pointer; user-select: none; }
.remember-row input { cursor: pointer; }
