/* =========================================================
 * iOS Reminders / iOS Settings 视觉设计系统
 * 适用：移动端 sheet、扫码/上传独立页、PC 弹窗
 * 规范来源：iOS 17 Reminders「新增待办」样式
 *   - 系统灰分组背景 #F2F2F7
 *   - 白色圆角分组容器，列表行 label-left / value-right / › chevron
 *   - 行间分隔 1px（iOS 为 0.5x retina = 0.5px / 普通屏为 1px）
 *   - 系统红 #FF3B30（危险/删除）+ 系统蓝 #007AFF（主操作）
 *   - 中文友好字体栈（PingFang SC / 苹方 / 微软雅黑）
 * ========================================================= */

/* ---------- iOS Reset ---------- */
.ios, .ios * { box-sizing: border-box; }
.ios {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Display",
    "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #000;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 17px;
  line-height: 1.4;
}

/* ---------- Page-level (扫码页用) ---------- */
.ios-page {
  min-height: 100vh;
  background: #F2F2F7;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  margin: 0;
}
.ios-page-title {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: #000;
  padding: 14px 16px 18px;
  letter-spacing: 0.2px;
}
.ios-page-sub {
  text-align: center;
  font-size: 13px;
  color: #8E8E93;
  margin: -8px 0 14px;
  padding: 0 24px;
  line-height: 1.5;
}
.ios-foot-meta {
  text-align: center;
  font-size: 12px;
  color: #8E8E93;
  padding: 14px 0 6px;
  letter-spacing: 0.3px;
}

/* ---------- Section header (iOS 表头小灰字) ---------- */
.ios-section-head {
  font-size: 13px;
  color: #6D6D72;
  text-transform: none;
  margin: 22px 0 6px 16px;
  letter-spacing: 0.2px;
}

/* ---------- Group (白底圆角行容器) ---------- */
.ios-group {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin: 0 0 8px;
}

/* 单行（label-left | value-right + › chevron） */
.ios-row {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(60,60,67,0.18);
  cursor: pointer;
  transition: background 0.15s;
}
.ios-row:last-child { border-bottom: 0; }
.ios-row:active { background: #D9D9D9; }

.ios-row .lbl {
  flex: 0 0 auto;
  min-width: 92px;
  font-size: 16px;
  color: #000;
  font-weight: 500;
  padding-right: 12px;
  white-space: nowrap;
}
.ios-row .lbl .req { color: #dc2626; margin-left: 2px; }
.ios-row .val {
  flex: 1 1 auto;
  font-size: 16px;
  color: #8E8E93;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ios-row .val.has-value { color: #000; }
.ios-row .val.has-error { color: #FF3B30; }
.ios-row .chev {
  flex: 0 0 auto;
  width: 8px;
  height: 13px;
  margin-left: 6px;
  opacity: 0.55;
  /* chevron 用 SVG 背景图，class 用 .chev */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 13'><path d='M1 1l5.5 5.5L1 12' fill='none' stroke='%23C7C7CC' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right center;
}
.ios-row.no-chev .chev { display: none; }

/* 整行 input 嵌进 row（不要外层 label/外层 input 分离） */
.ios-row input.ios-input,
.ios-row select.ios-select,
.ios-row textarea.ios-input {
  flex: 1 1 auto;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  color: #000;
  text-align: right;
  width: 100%;
  padding: 0;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}
.ios-row input.ios-input::placeholder,
.ios-row textarea.ios-input::placeholder { color: #8E8E93; }

.ios-row.is-picker .val { color: #000; }     /* picker 上的右值显示当前选中 */
.ios-row.is-error { background: rgba(255,59,48,0.08); }

/* 独立大输入框（title / url） */
.ios-field-input {
  display: block;
  width: 100%;
  background: #fff;
  border: 0;
  outline: 0;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 16px;
  color: #000;
  margin: 0 0 8px;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}
.ios-field-input::placeholder { color: #8E8E93; }
.ios-field-input:focus { box-shadow: 0 0 0 2px rgba(0,122,255,0.55); }

/* ---------- Modal（弹层）---------- */
.ios-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ios-modal-mask.show { display: flex; }
.ios-modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  box-shadow: 0 12px 36px rgba(0,0,0,0.18);
  animation: iosPop .2s cubic-bezier(0.32, 0.72, 0.0, 1.0);
}
@keyframes iosPop {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.ios-modal-head {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 16px 44px 14px;
  border-bottom: 1px solid rgba(60,60,67,0.18);
}
.ios-modal-head .title {
  font-size: 17px;
  font-weight: 600;
  color: #000;
  text-align: center;
  flex: 1;
}
.ios-modal-head .close {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  border: 0;
  background: transparent;
  font-size: 22px;
  color: #8E8E93;
  cursor: pointer;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.ios-modal-head .close:active { background: rgba(0,0,0,0.06); }

.ios-modal-body { padding: 16px 16px 4px; }

/* iOS 弹窗底栏（取消 | 主操作）—— 1px 顶部分隔线 */
.ios-modal-foot {
  display: flex;
  border-top: 1px solid rgba(60,60,67,0.18);
  margin-top: 14px;
  background: #fff;
}
.ios-modal-foot button {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 17px;
  padding: 14px;
  cursor: pointer;
  color: #007AFF;
  border-right: 1px solid rgba(60,60,67,0.18);
  font-family: inherit;
  font-weight: 400;
}
.ios-modal-foot button:last-child { border-right: 0; }
.ios-modal-foot button.destructive { color: #FF3B30; font-weight: 600; }
.ios-modal-foot button:active { background: #D9D9D9; }

/* ---------- Buttons 通用 ---------- */
.ios-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 13px 18px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  background: #fff;
  color: #007AFF;
}
.ios-btn.primary { background: #007AFF; color: #fff; }
.ios-btn.destructive { background: #FF3B30; color: #fff; }
.ios-btn.success { background: #34C759; color: #fff; }
.ios-btn.disabled, .ios-btn:disabled {
  background: #E5E5EA; color: #8E8E93; cursor: not-allowed;
}
.ios-btn:active:not(:disabled) { filter: brightness(0.92); }

.ios-btn-block { display: flex; width: 100%; }

/* ---------- Sheet（移动端底部弹出） ---------- */
.ios-sheet-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9990;
  display: none;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.ios-sheet-mask.show { display: block; }
.ios-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #F2F2F7;
  border-radius: 14px 14px 0 0;
  z-index: 9991;
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(0.32, 0.72, 0.0, 1.0);
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
  max-height: 92vh;
  overflow: auto;
}
.ios-sheet.show { transform: translateY(0); }
.ios-sheet-head {
  display: flex; align-items: center; justify-content: center;
  position: relative;
  padding: 10px 44px 12px;
  background: #F2F2F7;
  position: sticky; top: 0; z-index: 2;
}
.ios-sheet-head .title {
  font-size: 17px; font-weight: 600; color: #000; text-align: center;
}
.ios-sheet-head .close {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; background: transparent;
  font-size: 22px; color: #8E8E93; cursor: pointer; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.ios-sheet-head .close:active { background: rgba(0,0,0,0.08); }
.ios-sheet-body { padding: 4px 8px 14px; }

.ios-sheet-foot {
  display: flex;
  gap: 8px;
  padding: 8px 0 calc(0px + env(safe-area-inset-bottom));
}
.ios-sheet-foot .ios-btn { flex: 1; }
.ios-sheet-foot .ios-btn.flex2 { flex: 2; }

/* ---------- Chips / Pickers ---------- */
.ios-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 14px;
}
.ios-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: #E5E5EA;
  color: #000;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 0;
  font-family: inherit;
}
.ios-chip.selected { background: #007AFF; color: #fff; }
.ios-chip:active { filter: brightness(0.9); }

/* ---------- Done / Empty ---------- */
.ios-done {
  text-align: center;
  padding: 32px 24px;
}
.ios-done .icon {
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  background: #34C759;
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
}
.ios-done h2 { font-size: 18px; color: #000; margin: 0 0 8px; font-weight: 600; }
.ios-done p  { font-size: 14px; color: #8E8E93; line-height: 1.6; margin: 0; }
.ios-empty {
  text-align: center; font-size: 13px; color: #8E8E93; padding: 24px 0;
}

/* ---------- Hint / Error ---------- */
.ios-hint {
  font-size: 13px; color: #8E8E93;
  margin: 4px 0 14px;
  padding: 0 16px;
  line-height: 1.5;
}
.ios-error-box {
  display: none;
  background: rgba(255,59,48,0.1);
  border: 1px solid #FF3B30;
  border-radius: 10px;
  color: #FF3B30;
  font-size: 14px;
  padding: 10px 14px;
  margin: 0 0 12px;
  line-height: 1.5;
}
.ios-error-box.show { display: block; }
.ios-field-err {
  display: none;
  font-size: 13px;
  color: #FF3B30;
  padding: 4px 16px 0;
  margin: -6px 0 6px;
}
.ios-field-err.show { display: block; }

/* 高亮错误行 */
.ios-row.is-invalid,
.ios-field-input.is-invalid {
  box-shadow: inset 0 0 0 1.5px #FF3B30;
  background: rgba(255,59,48,0.04);
}

/* ---------- File picker 列表（合同附件页） ---------- */
.ios-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(60,60,67,0.18);
}
.ios-file-row:last-child { border-bottom: 0; }
.ios-file-row .name {
  flex: 1; min-width: 0;
  font-size: 15px; color: #000;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ios-file-row .name a { color: #007AFF; text-decoration: none; }
.ios-file-row .meta { font-size: 12px; color: #8E8E93; margin-top: 2px; }
.ios-file-row .del {
  border: 0; background: transparent;
  color: #FF3B30; font-size: 15px;
  padding: 4px 8px; cursor: pointer;
}

/* ---------- 紫蓝渐变登录头部（保留原 page 第一屏彩色 hero） ---------- */
.ios-hero {
  margin: 0 0 20px;
  padding: 28px 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, #5856D6 0%, #007AFF 100%);
  color: #fff;
  text-align: left;
}
.ios-hero h1 {
  font-size: 22px; font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: 0.3px;
}
.ios-hero p {
  font-size: 13px;
  margin: 4px 0 0;
  opacity: 0.92;
  line-height: 1.5;
}

/* ---------- Type pills (重复类型选择 永不/每天/每周/每月/每年 ) ---------- */
.ios-type-pill {
  display: flex;
  background: #E5E5EA;
  border-radius: 10px;
  padding: 3px;
  margin: 12px 16px 16px;
}
.ios-type-pill button {
  flex: 1;
  border: 0; background: transparent;
  padding: 7px 0;
  font-size: 14px;
  color: #000;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}
.ios-type-pill button.selected { background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.08); font-weight: 600; }
.ios-type-pill button:active { filter: brightness(0.95); }

/* ---------- Misc ---------- */
.ios-link { color: #007AFF; text-decoration: none; }
.ios-link:hover { text-decoration: underline; }
.ios-muted { color: #8E8E93; }
.ios-sep-h { height: 1px; background: rgba(60,60,67,0.18); margin: 8px 0; }
.ios-mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; }

/* iOS 风描述段落 */
.ios-prose {
  font-size: 14px;
  color: #6D6D72;
  line-height: 1.55;
  margin: 0 0 8px;
  padding: 0 16px;
}
