/* 柬埔寨 HR 智能中枢 - 手机端极速录入专用样式 (Mobile Input Hub) */
:root {
  --bg-dark: #0b1120;
  --bg-card: rgba(30, 41, 59, 0.75);
  --bg-card-hover: rgba(51, 65, 85, 0.85);
  --bg-input: rgba(15, 23, 42, 0.85);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: #3b82f6;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #cbd5e1;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.12) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 顶部导航与状态栏 */
.mobile-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(11, 17, 32, 0.85);
  border-bottom: 1px solid var(--border-color);
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-flag {
  font-size: 24px;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.brand-badge {
  font-size: 11px;
  background: rgba(37, 99, 235, 0.25);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
}

.btn-desktop {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-sub);
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid var(--border-color);
}

/* 主内容容器 */
.mobile-container {
  max-width: 540px;
  margin: 0 auto;
  padding: 16px;
}

/* 顶部分段切换器 (Segmented Control) */
.segmented-control {
  display: flex;
  background: rgba(15, 23, 42, 0.9);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  position: relative;
}

.segment-btn {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.segment-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* 卡片容器 */
.card-section {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

/* 文本粘贴区 */
.paste-box-wrapper {
  position: relative;
}

.input-textarea {
  width: 100%;
  min-height: 120px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 12px;
  font-size: 16px; /* 防止 iOS 自动聚焦缩放 */
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.input-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* 按钮组 */
.action-btn-group {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-touch {
  flex: 1;
  min-height: 48px; /* 触控标准 */
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-touch:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

/* 快捷示例胶囊 */
.sample-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip-sample {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
}

.chip-sample:active {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

/* 结构化表单字段 */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
}

.form-input {
  width: 100%;
  min-height: 48px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0 12px;
  font-size: 16px; /* 防止 iOS 自动放大 */
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* 交互式标签选择器 (Chips / Pills) */
.pill-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.pill-item {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.pill-item.active {
  background: rgba(37, 99, 235, 0.25);
  border-color: #3b82f6;
  color: #60a5fa;
  font-weight: 600;
}

.pill-item.active-green {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #34d399;
  font-weight: 600;
}

/* 抽屉浮层 (Drawer / Bottom Sheet) */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-content {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 560px;
  margin: 0 auto;
  background: #111827;
  border-top: 1px solid var(--border-color);
  border-radius: 24px 24px 0 0;
  padding: 16px 18px calc(24px + env(safe-area-inset-bottom));
  z-index: 101;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.drawer-overlay.open .drawer-content {
  transform: translateY(0);
}

.drawer-handle {
  width: 44px;
  height: 5px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  margin: 0 auto 14px;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.drawer-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.drawer-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}

.drawer-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

/* 匹配候选人卡片 */
.match-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

.match-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.match-pos {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.match-score-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.match-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.match-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.match-tag {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-sub);
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-copy-card {
  width: 100%;
  min-height: 40px;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-copy-card:active {
  background: rgba(37, 99, 235, 0.35);
}

/* Toast 提示 */
.toast-msg {
  position: fixed;
  top: calc(70px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  color: #fff;
  border: 1px solid var(--border-color);
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.toast-msg.success {
  border-color: rgba(16, 185, 129, 0.5);
}

.toast-msg.error {
  border-color: rgba(239, 68, 68, 0.5);
}
