* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: #f5f6f8;
  color: #333;
  font-size: 14px;
  min-height: 100vh;
}
.header {
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  color: #fff;
  padding: 20px 16px 30px;
  text-align: center;
  position: relative;
}
.header h1 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.header p { font-size: 13px; opacity: 0.9; }
.header .back-btn {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
}
.container {
  max-width: 480px;
  margin: -20px auto 0;
  padding: 0 16px;
}
.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}
.btn-primary {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  color: #fff;
  border: none;
  border-radius: 23px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-primary:active { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary {
  width: 100%;
  height: 46px;
  background: #fff;
  color: #ff6b35;
  border: 1px solid #ff6b35;
  border-radius: 23px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:active { background: #fff5f0; }
.btn-danger {
  width: 100%;
  height: 46px;
  background: #fff;
  color: #f44336;
  border: 1px solid #f44336;
  border-radius: 23px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-danger:active { background: #fff0f0; }
.form-item {
  margin-bottom: 14px;
}
.form-item label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}
.form-item input, .form-item textarea {
  width: 100%;
  height: 44px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 15px;
  background: #fafafa;
  color: #333;
}
.form-item input:focus, .form-item textarea:focus {
  outline: none;
  border-color: #ff6b35;
  background: #fff;
}
.form-item textarea {
  height: 100px;
  padding: 12px;
  resize: vertical;
}
.tabs {
  display: flex;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 16px;
}
.tab-item {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
  color: #999;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab-item.active {
  color: #ff6b35;
  border-bottom-color: #ff6b35;
  font-weight: 600;
}
.empty {
  text-align: center;
  padding: 40px 0;
  color: #999;
  font-size: 14px;
}
.loading {
  text-align: center;
  padding: 30px 0;
  color: #999;
  font-size: 14px;
}
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid #f0f0f0;
  border-top-color: #ff6b35;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.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: 1000;
  padding: 20px;
}
.modal-content {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.modal-btn {
  flex: 1;
  height: 40px;
  border-radius: 20px;
  border: none;
  font-size: 14px;
  cursor: pointer;
}
.modal-btn-primary {
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  color: #fff;
}
.modal-btn-cancel {
  background: #f5f5f5;
  color: #666;
}
.status-tag {
  display: inline-block;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 12px;
}
.status-tag.pending { background: #fff7e6; color: #fa8c16; }
.status-tag.signed { background: #f6ffed; color: #52c41a; }
.status-tag.rejected { background: #fff2f0; color: #ff4d4f; }
.list-item {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 12px;
  cursor: pointer;
}
.list-item:active { opacity: 0.9; }
.list-item .item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.list-item .item-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}
.list-item .item-info {
  font-size: 13px;
  color: #999;
  margin-bottom: 8px;
}
.list-item .item-parties {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #666;
}
.footer-btn {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  padding-bottom: calc(16px + constant(safe-area-inset-bottom));
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  background: #fff;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  display: flex;
  gap: 12px;
}
.footer-btn .btn {
  flex: 1;
  height: 46px;
  border-radius: 23px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.footer-btn .btn-primary {
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  color: #fff;
}
.footer-btn .btn-secondary {
  background: #f5f5f5;
  color: #666;
}
.signature-area {
  position: relative;
  height: 200px;
  background: #fafafa;
  border: 2px dashed #ddd;
  border-radius: 8px;
  cursor: crosshair;
}
.signature-area canvas {
  width: 100%;
  height: 100%;
}
.signature-area .clear-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 13px;
  color: #ff6b35;
  padding: 6px 12px;
  background: #fff;
  border-radius: 16px;
  cursor: pointer;
}
.personal-header {
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  color: #fff;
  padding: 40px 16px 30px;
  text-align: center;
}
.avatar-wrap {
  margin-bottom: 20px;
}
.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.5);
}
.personal-header .title {
  font-size: 22px;
  font-weight: 600;
  margin-top: 12px;
}
.personal-header .subtitle {
  font-size: 14px;
  opacity: 0.9;
  margin-top: 6px;
}
.contact-info {
  display: flex;
  justify-content: center;
  gap: 24px;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  opacity: 0.9;
}
.services-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.service-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(33.33% - 8px);
  padding: 20px 12px;
  background: #f8f9fa;
  border-radius: 12px;
}
.service-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.service-name {
  font-size: 12px;
  color: #333;
  text-align: center;
}
.contact-actions {
  display: flex;
  gap: 12px;
}
.action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px;
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
}
.action-btn:active { opacity: 0.85; }
.action-icon {
  font-size: 32px;
  margin-bottom: 6px;
}
.action-text {
  font-size: 12px;
}
.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}
.section-body {
  font-size: 14px;
  color: #666;
  line-height: 1.8;
}
.content-scroll {
  max-height: 500px;
  overflow-y: auto;
}
.content-body {
  font-size: 14px;
  color: #333;
  line-height: 1.8;
}
.signatures-list {
  margin-top: 12px;
}
.signature-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f5f5f5;
}
.signature-item:last-child { border-bottom: none; }
.sign-avatar {
  width: 48px;
  height: 48px;
  background: #ff6b35;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 20px;
}
.sign-info {
  flex: 1;
}
.sign-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
.sign-phone {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}
.sign-time {
  font-size: 12px;
  color: #bbb;
  margin-top: 2px;
}
.sign-role {
  font-size: 12px;
  color: #ff6b35;
  padding: 4px 12px;
  background: #fff5f0;
  border-radius: 12px;
}
.parties {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.party-card {
  flex: 1;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.party-label {
  font-size: 11px;
  color: #999;
  padding: 4px 12px;
  background: #fff;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 10px;
}
.party-name {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}
.party-phone {
  font-size: 12px;
  color: #999;
  margin-top: 6px;
}
.preview-box {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 13px;
  color: #333;
  line-height: 1.6;
}
.template-item {
  display: flex;
  align-items: center;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 2px solid transparent;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.template-item.active {
  background: #fff5f0;
  border-color: #ff6b35;
}
.template-icon {
  font-size: 32px;
  margin-right: 12px;
}
.template-info {
  flex: 1;
}
.template-name {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}
.template-desc {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}
.template-check {
  width: 24px;
  height: 24px;
  background: #ff6b35;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.section-hint {
  font-size: 12px;
  font-weight: normal;
  color: #999;
}
.attachment-list {
  margin-bottom: 16px;
}
.attachment-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
  border: 2px dashed #ddd;
  border-radius: 8px;
  background: #fafafa;
}
.empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.empty-text {
  font-size: 14px;
  color: #999;
}
.attachment-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 10px;
}
.attachment-icon {
  font-size: 24px;
  margin-right: 12px;
}
.attachment-info {
  flex: 1;
}
.attachment-name {
  font-size: 14px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-size {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}
.attachment-status {
  font-size: 16px;
  padding: 6px;
}
.attachment-status.uploading { color: #faad14; }
.attachment-status.success { color: #52c41a; }
.attachment-status.error { color: #ff4d4f; }
.btn-sm {
  height: 36px;
  font-size: 14px;
  border-radius: 18px;
}
.attachment-download-btn {
  font-size: 12px;
  color: #ff6b35;
  padding: 4px 8px;
  background: #fff5f0;
  border-radius: 6px;
  cursor: pointer;
}
.attachment-delete-btn {
  font-size: 12px;
  color: #ff4d4f;
  padding: 4px 8px;
  background: #fff2f0;
  border-radius: 6px;
  cursor: pointer;
}
.multi-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0 12px;
  background: #fafafa;
  cursor: pointer;
}
.multi-select:active {
  border-color: #ff6b35;
  background: #fff;
}
.multi-select-value {
  font-size: 15px;
  color: #999;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.multi-select-arrow {
  font-size: 12px;
  color: #999;
  transition: transform 0.2s;
}
.multi-select-options {
  margin-top: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  max-height: 200px;
  overflow-y: auto;
}
.multi-select-option {
  display: flex;
  align-items: center;
  padding: 12px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
}
.multi-select-option:last-child {
  border-bottom: none;
}
.multi-select-option:active {
  background: #fff5f0;
}
.multi-select-option input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  accent-color: #ff6b35;
}
