/* ============================================
   定阅 - 样式表
   移动优先 / 极简 / 系统字体
   ============================================ */

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

:root {
  --primary: #1a1a1a;
  --accent: #ff5722;
  --bg: #fafafa;
  --card-bg: #ffffff;
  --border: #eee;
  --muted: #999;
  --danger: #ff3b30;
  --success: #34c759;
  --radius: 12px;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--primary);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ============================================
   登录页
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.logo {
  font-size: 48px;
  text-align: center;
  margin-bottom: 8px;
}

.login-card h1 {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-card .muted {
  text-align: center;
  margin-bottom: 28px;
}

/* ============================================
   表单
   ============================================ */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: #fafafa;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background: #fff;
}

.otp-row {
  display: flex;
  gap: 8px;
}

.otp-row input {
  flex: 1;
}

.otp-row .btn-secondary {
  white-space: nowrap;
}

.muted.small {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ============================================
   按钮
   ============================================ */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary:hover {
  background: #000;
}

.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}

.btn-text {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 12px;
}

.btn-block {
  display: block;
  width: 100%;
  margin-top: 12px;
}

.footer-tip {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 20px;
}

/* ============================================
   主页面
   ============================================ */
.app-page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}

.app-header {
  background: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header h1 {
  font-size: 20px;
  font-weight: 700;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.user-id {
  color: var(--muted);
}

/* ============================================
   添加卡(顶部)
   ============================================ */
.add-card {
  margin: 20px;
  background: var(--card-bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.add-card:hover {
  border-color: var(--primary);
  background: #f9f9f9;
}

.add-icon {
  font-size: 36px;
  font-weight: 200;
  color: var(--muted);
  margin-bottom: 4px;
}

.add-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 4px;
}

.add-hint {
  font-size: 12px;
  color: var(--muted);
}

/* ============================================
   列表卡片
   ============================================ */
.list-container {
  padding: 0 20px 80px;
}

.loading, .empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  font-size: 14px;
}

.card {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.card:active {
  background: #f5f5f5;
  transform: scale(0.98);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  margin-right: 12px;
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-remark {
  font-size: 15px;
  font-weight: 500;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.card-delete {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.card-delete:hover {
  color: var(--danger);
}

/* ============================================
   弹窗
   ============================================ */
.modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px 20px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.3s;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.modal-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.modal-card p {
  color: var(--muted);
  margin-bottom: 4px;
  font-size: 14px;
}

.modal-card .muted {
  color: var(--muted);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.modal-actions .btn-primary {
  text-decoration: none;
  display: block;
}

.modal-actions .btn-text {
  display: block;
  width: 100%;
}

/* ============================================
   预览框
   ============================================ */
.preview-box {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid;
}

.preview-ok {
  background: #f0fdf4;
  color: #166534;
  border-color: #86efac;
}

.preview-fail {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fca5a5;
}

/* ============================================
   Toast
   ============================================ */
.toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 10px 20px;
  border-radius: 22px;
  font-size: 14px;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  max-width: 80%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success { background: rgba(52, 199, 89, 0.95); }
.toast-error   { background: rgba(255, 59, 48, 0.95); }
.toast-info    { background: rgba(0, 0, 0, 0.85); }
