/* 基石移动办公壳 — OA 审批（仅移动端布局） */
:root {
  --m-bg: #f1f5f9;
  --m-surface: #ffffff;
  --m-text: #0f172a;
  --m-muted: #64748b;
  --m-brand: #0369a1;
  --m-danger: #dc2626;
  --m-success: #059669;
  --m-border: #e2e8f0;
  --m-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  color: var(--m-text);
  background: var(--m-bg);
  -webkit-tap-highlight-color: transparent;
}

.m-app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(56px + var(--m-safe-bottom));
}

.m-app.m-app--detail {
  padding-bottom: calc(72px + var(--m-safe-bottom));
}

.m-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--m-surface);
  border-bottom: 1px solid var(--m-border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.m-header__back {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px 4px 0;
  color: var(--m-brand);
  cursor: pointer;
}

.m-header__title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-header__shell-link {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--m-brand);
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid var(--m-border);
  border-radius: 999px;
  white-space: nowrap;
}

.m-header__user {
  font-size: 12px;
  color: var(--m-muted);
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-tabs {
  display: flex;
  background: var(--m-surface);
  border-bottom: 1px solid var(--m-border);
  position: sticky;
  top: 49px;
  z-index: 19;
}

.m-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 8px;
  font-size: 15px;
  color: var(--m-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.m-tab.m-tab--active {
  color: var(--m-brand);
  border-bottom-color: var(--m-brand);
  font-weight: 600;
}

.m-list {
  padding: 12px 16px 24px;
  flex: 1;
}

.m-card {
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  text-align: left;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.m-card:active {
  background: #f8fafc;
}

.m-card__type {
  font-size: 12px;
  color: var(--m-brand);
  font-weight: 600;
  margin-bottom: 4px;
}

.m-card__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
}

.m-card__meta {
  font-size: 13px;
  color: var(--m-muted);
  line-height: 1.5;
}

.m-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  margin-top: 8px;
}

.m-empty,
.m-loading {
  text-align: center;
  padding: 48px 24px;
  color: var(--m-muted);
  font-size: 15px;
  line-height: 1.6;
}

.m-detail {
  padding: 16px;
  flex: 1;
}

.m-section {
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.m-section__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--m-muted);
  text-transform: none;
  margin: 0 0 10px;
  letter-spacing: 0.02em;
}

.m-kv {
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.m-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--m-text);
  margin: 4px 0 8px;
}

.m-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.m-steps li {
  position: relative;
  padding: 0 0 14px 20px;
  font-size: 14px;
  line-height: 1.5;
  border-left: 2px solid var(--m-border);
  margin-left: 6px;
}

.m-steps li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.m-steps li::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--m-border);
}

.m-steps li.m-steps__item--done::before {
  background: var(--m-success);
}

.m-steps li.m-steps__item--pending::before {
  background: var(--m-brand);
}

.m-attach-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.m-attach-list a {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--m-border);
  color: var(--m-brand);
  text-decoration: none;
  font-size: 15px;
}

.m-attach-list li:last-child a {
  border-bottom: none;
}

.m-callout {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.m-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + var(--m-safe-bottom));
  background: var(--m-surface);
  border-top: 1px solid var(--m-border);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

.m-btn {
  flex: 1;
  min-height: 48px;
  border-radius: 10px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.m-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.m-btn--primary {
  background: var(--m-brand);
  color: #fff;
}

.m-btn--danger {
  background: #fef2f2;
  color: var(--m-danger);
  border: 1px solid #fecaca;
}

.m-btn--secondary {
  background: #f1f5f9;
  color: var(--m-text);
  border: 1px solid var(--m-border);
}

.m-login {
  max-width: 400px;
  margin: 0 auto;
  padding: 32px 20px;
}

.m-login h1 {
  font-size: 22px;
  margin: 0 0 8px;
}

.m-login p {
  color: var(--m-muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 24px;
}

.m-field {
  margin-bottom: 16px;
}

.m-field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}

.m-field input,
.m-field textarea,
.m-field select {
  width: 100%;
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--m-border);
  border-radius: 10px;
  background: #fff;
}

.m-field textarea {
  min-height: 88px;
  resize: vertical;
}

.m-toast-stack {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 100;
  pointer-events: none;
}

.m-toast {
  background: #1e293b;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  pointer-events: auto;
}

.m-toast--error {
  background: #7f1d1d;
}

.m-toast--success {
  background: #065f46;
}

.m-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-end;
}

.m-sheet__panel {
  width: 100%;
  max-height: 85vh;
  overflow: auto;
  background: var(--m-surface);
  border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(16px + var(--m-safe-bottom));
}

.m-sheet__title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 16px;
}

.m-sheet-msg {
  font-size: 14px;
  line-height: 1.5;
  color: var(--m-text-secondary, #64748b);
  margin: 0 0 12px;
  white-space: pre-wrap;
}

.m-link-desktop {
  display: block;
  text-align: center;
  margin: 8px 16px 24px;
  font-size: 14px;
  color: var(--m-brand);
}

.hidden {
  display: none !important;
}

/* 与桌面端界面主题同步：读取同一 cornerstone-ui-theme 存储（见 theme-boot.js） */
html[data-theme] {
  color-scheme: light;
  --m-brand: var(--ds-brand, #0369a1);
  --m-bg: var(--ds-bg-canvas, #f1f5f9);
  --m-surface: var(--ds-bg-surface, #ffffff);
  --m-text: var(--ds-text, #0f172a);
  --m-muted: var(--ds-text-secondary, #64748b);
  --m-border: var(--ds-border, #e2e8f0);
  --m-danger: var(--ds-danger, #dc2626);
  --m-success: var(--ds-success, #059669);
}
