/* ============================================================
   设计系统 · 简洁高级
   ============================================================ */
:root {
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e8ecf3;
  --bg: #f5f7fa;
  --card: #ffffff;
  --sider: #0b1220;
  --radius: 14px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.08);
  --shadow-pop: 0 24px 64px -16px rgba(15, 23, 42, 0.22);
}

html,
body,
#root {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-feature-settings: 'tnum';
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--ink);
}

/* ============================================================
   登录 / 注册：分屏高级版式
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(79, 70, 229, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(124, 58, 237, 0.08), transparent 55%),
    var(--bg);
}

.auth-shell {
  width: min(1080px, 100%);
  min-height: min(660px, calc(100vh - 64px));
  display: flex;
  background: var(--card);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-pop);
  border: 1px solid rgba(232, 236, 243, 0.9);
}

/* 左侧品牌视觉 */
.auth-visual {
  flex: 0 0 44%;
  position: relative;
  background-image: url('/auth-hero.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}
.auth-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, rgba(15, 23, 42, 0) 30%, rgba(15, 23, 42, 0.72) 100%);
}
.auth-visual-inner {
  position: relative;
  z-index: 1;
  padding: 40px;
  color: #fff;
}
.auth-visual-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.95;
  margin-bottom: 14px;
}
.auth-visual-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin: 0 0 8px;
}
.auth-visual-desc {
  font-size: 13.5px;
  line-height: 1.7;
  opacity: 0.82;
  margin: 0;
}

/* 右侧表单面板 */
.auth-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  overflow-y: auto;
}
.auth-panel-inner {
  width: 100%;
  max-width: 400px;
}

/* 无图模式（如注册页移动端）或旧结构的兜底 */
.auth-card {
  width: 420px;
  max-width: 100%;
  box-shadow: none;
  border: none;
}
.auth-card .ant-card-body {
  padding: 0;
}

.auth-title {
  text-align: center;
  margin-bottom: 4px;
}

.auth-subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 24px;
}

/* ============================================================
   主布局：侧边栏 + 顶栏
   ============================================================ */
.app-sider {
  background: var(--sider) !important;
  box-shadow: 1px 0 0 rgba(15, 23, 42, 0.06);
}
.app-sider .ant-layout-sider-children {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.app-sider .ant-menu {
  background: transparent;
}
.app-sider .ant-menu-item,
.app-sider .ant-menu-submenu-title {
  border-radius: 10px;
  margin-inline: 10px;
  width: auto;
}
.app-sider .ant-menu-item-selected {
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.95), rgba(99, 102, 241, 0.85)) !important;
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, 0.55);
}
.app-sider .ant-menu-item:hover,
.app-sider .ant-menu-submenu-title:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sider-brand {
  flex: 0 0 auto;
  height: 52px;
  margin: 14px 14px 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.35), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.app-header {
  background: rgba(255, 255, 255, 0.86) !important;
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line) !important;
  box-shadow: none !important;
}

/* ============================================================
   页面容器与卡片
   ============================================================ */
.page-container {
  padding: 24px;
}

.page-card,
.ant-card {
  border-radius: var(--radius);
  border-color: var(--line);
  box-shadow: var(--shadow-card);
}
.ant-card .ant-card-head {
  border-bottom-color: var(--line);
  min-height: 56px;
}
.ant-card .ant-card-head-title {
  font-weight: 600;
}

/* 统计卡片 */
.stat-card .ant-statistic-title {
  color: var(--muted);
}
.stat-card .ant-statistic-content {
  font-weight: 700;
  color: var(--ink);
}

.stat-icon {
  font-size: 26px;
  border-radius: 12px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 表格精修 */
.ant-table {
  border-radius: 12px;
}
.ant-table-thead > tr > th {
  background: #f8fafc !important;
  font-weight: 600;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line) !important;
}
.ant-table-tbody > tr:hover > td {
  background: #f6f8ff !important;
}
.ant-table-tbody > tr > td {
  border-bottom-color: #f1f4f9 !important;
}

/* 弹窗 / 抽屉圆角 */
.ant-modal .ant-modal-content,
.ant-drawer .ant-drawer-content {
  border-radius: 16px;
  overflow: hidden;
}
.ant-popover .ant-popover-inner {
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
}

/* 主按钮柔和投影 */
.ant-btn-primary {
  box-shadow: 0 6px 14px -6px rgba(79, 70, 229, 0.5);
}
.ant-btn-primary:hover {
  box-shadow: 0 8px 18px -6px rgba(79, 70, 229, 0.6);
}

/* 表格内金额强调色 */
.money {
  font-weight: 600;
  color: #fa541c;
}

/* 订单表格操作列按钮间距 */
.table-actions .ant-btn + .ant-btn {
  margin-left: 8px;
}

/* ========== 修图师任务卡片（移动端优先） ========== */
.task-card-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .task-card-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.task-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.task-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.task-order-no {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  word-break: break-all;
}

.task-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.task-label {
  flex-shrink: 0;
  width: 62px;
  color: var(--muted);
}

.task-value {
  flex: 1;
  color: var(--ink-2);
  word-break: break-all;
}

.task-muted {
  color: var(--muted);
  font-size: 13px;
}

.task-card-foot {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

.task-card-actions {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 修图录入区 */
.retouch-form {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.retouch-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.retouch-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.receipt-preview img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.receipt-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* 底片 / 精修成品上传 */
.delivery-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.delivery-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.delivery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.delivery-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.delivery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
}

.delivery-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: block;
}

/* ========== 移动端响应式 ========== */
@media (max-width: 900px) {
  .auth-visual {
    display: none;
  }
  .auth-shell {
    min-height: 0;
  }
  .auth-panel {
    padding: 32px 24px;
  }
}

@media (max-width: 767px) {
  .auth-page {
    padding: 16px;
  }
  .auth-card {
    width: 100%;
  }

  /* 卡片标题与右侧工具栏改为上下两行，避免窄屏挤压出界 */
  .ant-card-head-wrapper { flex-wrap: wrap; }
  .ant-card-head-title { flex: 0 0 100%; padding: 12px 0 0; }
  .ant-card-extra { margin-left: 0; padding: 8px 0 12px; width: 100%; }
  .ant-card-extra .ant-space { width: 100%; flex-wrap: wrap; }

  /* 内容区收紧，给表格留出更多宽度（登录/注册卡除外） */
  .ant-card:not(.auth-card) .ant-card-body { padding: 12px; }

  /* 表格横向滚动 */
  .ant-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ant-table-wrapper .ant-table-content {
    overflow-x: auto;
  }

  /* 表格内文字不换行 */
  .ant-table-cell {
    white-space: nowrap;
  }

  /* 减小按钮间距；Space 工具栏自动换行，避免整行溢出 */
  .ant-space {
    gap: 4px !important;
    flex-wrap: wrap;
  }

  /* 统计卡片间距 */
  .ant-col {
    margin-bottom: 12px;
  }

  /* 弹窗全屏 */
  .ant-modal {
    max-width: calc(100vw - 32px) !important;
    margin: 16px;
  }

  /* 通知面板宽度 */
  .ant-popover {
    max-width: 90vw;
  }

  /* 表单标签 */
  .ant-form-item-label {
    padding-bottom: 4px;
  }

  /* 减小页面标题 */
  h2 {
    font-size: 18px !important;
  }
}
