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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

/* ---------- 认证页（登录 / 注册） ---------- */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f5f5f5;
  padding: 20px;
}
.auth-card {
  background: #fff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}
.auth-card h1 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
  font-size: 28px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-size: 14px;
}
.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.3s;
}
.form-group input:focus { outline: none; border-color: #999; }

.error {
  color: #e74c3c;
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
  min-height: 1em;
}
.error:empty { min-height: 0; margin-bottom: 0; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  transition: background-color 0.3s;
}
.auth-card button[type="submit"] {
  width: 100%;
  padding: 12px;
  background-color: #666;
  color: #fff;
  font-size: 16px;
}
.auth-card button[type="submit"]:hover { background-color: #555; }

.auth-link {
  text-align: center;
  margin-top: 20px;
  color: #666;
  font-size: 14px;
}
.auth-link a { color: #666; font-weight: 500; text-decoration: none; }
.auth-link a:hover { text-decoration: underline; }

/* ---------- 剪切板页 ---------- */
.clipboard-container {
  min-height: 100vh;
  background-color: #f5f5f5;
  padding: 20px;
  max-width: 960px;
  margin: 0 auto;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.header h1 { color: #333; font-size: 28px; }
.user-info { display: flex; align-items: center; gap: 15px; }
.user-info span { color: #666; font-size: 14px; }

.logout-btn {
  padding: 8px 20px;
  background-color: #999;
  color: #fff;
  font-size: 14px;
}
.logout-btn:hover { background-color: #888; }

.add-item {
  background: #fff;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 25px;
}
.content-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  resize: vertical;
  margin-bottom: 15px;
  font-family: inherit;
  transition: border-color 0.3s;
}
.content-input:focus { outline: none; border-color: #999; }
.add-item button {
  padding: 10px 25px;
  background-color: #666;
  color: #fff;
  font-size: 14px;
}
.add-item button:hover { background-color: #555; }

.items-list { display: flex; flex-direction: column; gap: 20px; }

.item-card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s;
}
.item-card:hover { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15); }

.item-header { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 15px; }
.item-actions { display: flex; gap: 10px; }
.copy-btn { padding: 8px 16px; background-color: #888; color: #fff; font-size: 14px; }
.copy-btn:hover { background-color: #777; }
.delete-btn { padding: 8px 16px; background-color: #e74c3c; color: #fff; font-size: 14px; }
.delete-btn:hover { background-color: #c0392b; }

.item-content {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  resize: vertical;
  font-family: inherit;
  margin-bottom: 15px;
  transition: border-color 0.3s;
}
.item-content:focus { outline: none; border-color: #999; }

.item-footer { display: flex; justify-content: space-between; align-items: center; }
.item-time { color: #999; font-size: 12px; }
.save-status { color: #27ae60; font-size: 12px; min-height: 1em; }
.save-status.error { color: #e74c3c; margin: 0; text-align: right; }

.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state p { margin: 10px 0; font-size: 16px; }
.empty-state p:last-child { font-size: 14px; }
.loading-hint { text-align: center; color: #999; padding: 30px; }

/* ---------- 批量操作 ---------- */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 12px 16px;
  margin-bottom: 4px;
  font-size: 14px;
  color: #555;
}
.batch-bar label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.batch-bar input[type="checkbox"] { width: 16px; height: 16px; accent-color: #666; cursor: pointer; }
.batch-bar .spacer { flex: 1; }
.batch-delete-btn {
  padding: 8px 16px;
  background-color: #e74c3c;
  color: #fff;
  font-size: 14px;
}
.batch-delete-btn:hover:not(:disabled) { background-color: #c0392b; }
.batch-delete-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.item-checkbox { display: flex; align-items: center; margin-right: 10px; }
.item-checkbox input { width: 16px; height: 16px; accent-color: #666; cursor: pointer; }
.item-header { justify-content: space-between; }

/* ---------- Toast（页面上方居中） ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translate(-50%, -16px);
  background: rgba(51, 51, 51, 0.92);
  color: #fff;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999;
  max-width: 80vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 确认删除弹窗（居中 modal） ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-dialog {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  padding: 28px 28px 20px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.modal-dialog p {
  color: #333;
  font-size: 16px;
  margin-bottom: 22px;
  line-height: 1.6;
}
.modal-actions { display: flex; gap: 12px; justify-content: center; }
.modal-cancel {
  padding: 10px 22px;
  background: #f0f0f0;
  color: #555;
  font-size: 14px;
}
.modal-cancel:hover { background: #e4e4e4; }
.modal-confirm {
  padding: 10px 22px;
  background: #e74c3c;
  color: #fff;
  font-size: 14px;
}
.modal-confirm:hover { background: #c0392b; }
