/* ==========================================================================
   请假审批系统 - 全局样式
   风格：极简、白底黑字、移动端适配
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: #1a1a1a;
  background: #ffffff;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #2563eb;
  text-decoration: none;
}

/* ==========================================================================
   布局
   ========================================================================== */
.container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 56px;
}

.brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.nav a {
  color: #374151;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.95rem;
}

.nav a:hover {
  background: #f3f4f6;
  color: #111827;
}

.nav-user {
  margin-left: 6px;
  padding: 4px 10px;
  background: #f3f4f6;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #4b5563;
}

.nav-logout {
  color: #b91c1c !important;
}

.page-body {
  flex: 1;
  padding-top: 24px;
  padding-bottom: 40px;
}

.site-footer {
  border-top: 1px solid #e5e7eb;
  padding: 16px 0;
  font-size: 0.85rem;
  color: #9ca3af;
  text-align: center;
}

/* ==========================================================================
   卡片 / 表单
   ========================================================================== */
.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1.15rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.leave-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.field-half {
  flex: 1;
  min-width: 200px;
}

.field-label {
  font-size: 0.9rem;
  color: #374151;
}

.field input,
.field select,
.field textarea {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: #1a1a1a;
  width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  background: #f3f4f6;
  color: #111827;
}

.btn:hover {
  filter: brightness(0.96);
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-ok {
  background: #16a34a;
  color: #fff;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn-plain {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #374151;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   统计 / 表格
   ========================================================================== */
.stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.stat {
  flex: 1;
  min-width: 100px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: #111827;
}

.stat-label {
  font-size: 0.85rem;
  color: #6b7280;
}

.list-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 640px;
}

.table th,
.table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.table th {
  background: #f9fafb;
  color: #374151;
  font-weight: 600;
  white-space: nowrap;
}

.table tbody tr:hover {
  background: #fafafa;
}

.cell-reason {
  max-width: 260px;
  overflow-wrap: break-word;
}

.cell-actions {
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.badge-待审批 {
  background: #fef3c7;
  color: #92400e;
}

.badge-已通过 {
  background: #dcfce7;
  color: #166534;
}

.badge-已拒绝 {
  background: #fee2e2;
  color: #991b1b;
}

.empty-tip {
  color: #9ca3af;
  text-align: center;
  padding: 24px 0;
}

/* ==========================================================================
   提示消息
   ========================================================================== */
.flashes {
  margin-bottom: 14px;
}

.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.flash-ok {
  background: #dcfce7;
  color: #166534;
}

.flash-err,
.flash-warn {
  background: #fee2e2;
  color: #991b1b;
}

/* ==========================================================================
   登录页
   ========================================================================== */
.login-body {
  background: #f9fafb;
  justify-content: center;
  align-items: center;
}

.login-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 24px 16px;
}

.login-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 28px 24px;
}

.login-title {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 4px;
}

.login-sub {
  text-align: center;
  color: #6b7280;
  margin-bottom: 20px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-hint {
  margin-top: 18px;
  border-top: 1px dashed #e5e7eb;
  padding-top: 12px;
}

.login-hint summary {
  cursor: pointer;
  font-size: 0.88rem;
  color: #6b7280;
}

.hint-grid {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #4b5563;
  line-height: 1.8;
}

.hint-group {
  font-weight: 600;
  color: #111827;
}

/* ==========================================================================
   弹窗（拒绝理由）
   ========================================================================== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  width: 100%;
  max-width: 420px;
}

.modal-title {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.modal-sub {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 0;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }

  .card {
    padding: 16px;
  }

  .field-row {
    flex-direction: column;
    gap: 14px;
  }

  .field-half {
    min-width: 0;
  }
}