/* 梵净山OA - iPad 端样式 (Split View) */
:root {
  --primary-color: #1890ff;
  --success-color: #52c41a;
  --warning-color: #faad14;
  --error-color: #f5222d;
  --bg-gray: #f5f5f5;
  --border-color: #e8e8e8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif; background: var(--bg-gray); color: #333; font-size: 15px; }

/* iPad 框架 */
.ipad-container { display: flex; height: 100vh; overflow: hidden; }
.ipad-sidebar { width: 280px; background: #fff; border-right: 1px solid var(--border-color); display: flex; flex-direction: column; }
.ipad-sidebar-header { padding: 20px; border-bottom: 1px solid var(--border-color); }
.ipad-logo { font-size: 28px; margin-bottom: 4px; }
.ipad-title { font-size: 16px; font-weight: 500; }
.ipad-menu { flex: 1; overflow-y: auto; padding: 10px 0; }
.ipad-menu-item { display: flex; align-items: center; gap: 12px; padding: 14px 20px; color: #666; text-decoration: none; font-size: 15px; }
.ipad-menu-item:hover { background: #f8f9fa; }
.ipad-menu-item.active { background: rgba(24,144,255,0.08); color: var(--primary-color); font-weight: 500; }
.ipad-menu-icon { font-size: 20px; width: 28px; text-align: center; }
.ipad-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ipad-header { height: 64px; background: white; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.ipad-header-title { font-size: 18px; font-weight: 500; }
.ipad-content { flex: 1; overflow-y: auto; padding: 20px; }

/* iPad 分栏内容 */
.ipad-split { display: flex; height: 100%; gap: 16px; }
.ipad-master { width: 360px; background: white; border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; }
.ipad-detail { flex: 1; background: white; border-radius: 8px; padding: 20px; overflow-y: auto; }
.master-search { padding: 12px; border-bottom: 1px solid var(--border-color); }
.master-search input { width: 100%; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 14px; }
.master-list { flex: 1; overflow-y: auto; }
.master-item { padding: 14px 16px; border-bottom: 1px solid #f5f5f5; cursor: pointer; }
.master-item:hover { background: #fafafa; }
.master-item.active { background: rgba(24,144,255,0.06); border-left: 3px solid var(--primary-color); }
.master-title { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.master-desc { font-size: 12px; color: #999; }

/* 卡片 */
.ipad-card { background: white; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.ipad-card-title { font-size: 16px; font-weight: 500; margin-bottom: 12px; }
.ipad-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ipad-stat { text-align: center; padding: 16px; background: #fafafa; border-radius: 8px; }
.ipad-stat-num { font-size: 24px; font-weight: 600; color: var(--primary-color); margin-bottom: 4px; }
.ipad-stat-label { font-size: 13px; color: #666; }

/* 按钮 */
.ipad-btn { padding: 8px 16px; border-radius: 6px; border: none; font-size: 14px; cursor: pointer; }
.ipad-btn-primary { background: var(--primary-color); color: white; }
.ipad-btn-outline { background: white; color: var(--primary-color); border: 1px solid var(--primary-color); }
.ipad-btn-success { background: var(--success-color); color: white; }

/* 列表 */
.ipad-list-row { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid #f5f5f5; }
.ipad-list-row:last-child { border-bottom: none; }
.ipad-list-icon { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-right: 12px; }
.ipad-list-body { flex: 1; }
.ipad-list-title { font-size: 15px; margin-bottom: 2px; }
.ipad-list-desc { font-size: 12px; color: #999; }
.ipad-tag { font-size: 12px; padding: 2px 10px; border-radius: 12px; display: inline-block; }
.tag-pending { background: #fff7e6; color: #d46b08; }
.tag-approved { background: #f6ffed; color: #389e0d; }
.tag-rejected { background: #fff1f0; color: #cf1322; }

/* 日历 */
.ipad-calendar { background: white; border-radius: 8px; padding: 16px; }
.cal-month-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell { aspect-ratio: 1.2; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 14px; background: #fafafa; cursor: pointer; }
.cal-cell:hover { background: #f0f0f0; }
.cal-cell.today { background: var(--primary-color); color: white; }
.cal-cell.selected { background: #e6f7ff; color: var(--primary-color); border: 1px solid var(--primary-color); }
.cal-cell.other { color: #ccc; background: transparent; }
.cal-cell .evt { width: 5px; height: 5px; border-radius: 50%; background: var(--error-color); margin-top: 3px; }
.cal-weekday { text-align: center; font-size: 12px; color: #999; padding: 6px; }

/* 详情页 */
.detail-section { margin-bottom: 20px; }
.detail-section-title { font-size: 14px; color: #999; margin-bottom: 8px; }
.detail-section-content { font-size: 15px; line-height: 1.6; }
.attach-row { display: flex; align-items: center; gap: 10px; padding: 10px; background: #fafafa; border-radius: 6px; margin-bottom: 8px; cursor: pointer; }
.attach-row:hover { background: #f0f0f0; }

/* 时间轴 */
.ipad-timeline { position: relative; padding-left: 20px; }
.ipad-timeline::before { content: ''; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: #e8e8e8; }
.timeline-entry { position: relative; padding-bottom: 16px; }
.timeline-dot { position: absolute; left: -18px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary-color); border: 2px solid white; }
.timeline-time { font-size: 12px; color: #999; margin-bottom: 2px; }
.timeline-title { font-size: 15px; margin-bottom: 2px; }
.timeline-desc { font-size: 13px; color: #666; }

/* 浮层 */
.ipad-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 2000; display: none; align-items: center; justify-content: center; }
.ipad-overlay.active { display: flex; }
.ipad-preview-box { background: #1a1a1a; width: 90vw; height: 90vh; border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; }
.ipad-preview-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #222; color: white; }
.ipad-preview-body { flex: 1; overflow: hidden; }
.ipad-preview-body iframe { width: 100%; height: 100%; border: none; }
.ipad-preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
