* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f4f6f9; color: #222; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.top { background: #1e293b; color: #fff; padding: 12px 0; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.top a { color: #e2e8f0; text-decoration: none; margin-right: 12px; }
.top a:hover { color: #fff; }
.brand { font-weight: 700; margin-right: 20px; color: #fff !important; }
.main { padding: 24px 16px 48px; min-height: 60vh; }
.foot { padding: 16px; font-size: 13px; text-align: center; }
.muted { color: #64748b; font-size: 14px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
.card { background: #fff; border-radius: 10px; padding: 16px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.stat { font-size: 28px; font-weight: 700; color: #0f766e; }
.btn { display: inline-block; padding: 8px 16px; border-radius: 8px; border: none; background: #0d9488; color: #fff; cursor: pointer; text-decoration: none; font-size: 14px; }
.btn:hover { background: #0f766e; }
.btn.secondary { background: #64748b; }
.btn.secondary:hover { background: #475569; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label { display: block; margin: 10px 0 4px; font-weight: 600; font-size: 14px; }
/* 与表单控件同宽，左缘对齐，避免默认 p 边距造成错位 */
.form-hint {
  display: block;
  margin: 4px 0 12px;
  max-width: 420px;
  width: 100%;
  font-size: 13px;
  line-height: 1.45;
  font-weight: normal;
}
input[type=text], input[type=password], input[type=number], input[type=datetime-local], input[type=date], input[type=time], input[type=file], textarea {
  width: 100%; max-width: 420px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px;
}
/* 日期/时间：整块区域可点出系统选择器（避免只点到右侧小图标） */
input[type="datetime-local"],
input[type="date"],
input[type="time"] {
  position: relative;
  min-height: 48px;
  padding: 10px 12px;
  font-size: 16px; /* iOS 聚焦时减少自动缩放页面 */
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}
textarea { min-height: 100px; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
th, td { padding: 10px 12px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: top; }
th { background: #f8fafc; font-weight: 600; }
tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #e2e8f0; }
.badge.ok { background: #d1fae5; color: #065f46; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.err { background: #fee2e2; color: #991b1b; }
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert.ok { background: #d1fae5; color: #065f46; }
.alert.err { background: #fee2e2; color: #991b1b; }
.thumb { max-width: 120px; max-height: 120px; border-radius: 6px; margin: 4px 8px 4px 0; vertical-align: middle; }
.pics-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.copy-box { background: #f1f5f9; padding: 12px; border-radius: 8px; word-break: break-word; font-size: 14px; line-height: 1.6; }
.copy-box img { max-width: 100%; height: auto; border-radius: 6px; }
.copy-box p { margin: 0.5em 0; }
.copy-box ul, .copy-box ol { margin: 0.5em 0; padding-left: 1.25em; }
.actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* 全站公告横幅（导航正下方，登录用户） */
.xy-announcement-bar {
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  border-bottom: 1px solid #fdba74;
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.12);
  padding: 14px 0 16px;
}
.xy-announcement-bar-inner {
  border-left: 5px solid #ea580c;
  padding-left: 16px;
  margin-left: 0;
}
.xy-announcement-bar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 10px;
}
.xy-announcement-bar-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  background: #ea580c;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.xy-announcement-bar-title {
  font-size: 17px;
  color: #9a3412;
}
.xy-announcement-bar-body {
  font-size: 15px;
  line-height: 1.65;
  color: #431407;
}
.xy-announcement-bar .xy-workbench-rich a {
  color: #c2410c;
  font-weight: 600;
}
.xy-announcement-bar .xy-workbench-rich a:hover {
  color: #9a3412;
}

/* 待办摘要（用户端顶栏下） */
.xy-todo-bar {
  background: #e0f2fe;
  border-bottom: 1px solid #bae6fd;
  font-size: 14px;
}
.xy-todo-bar .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.xy-todo-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #7dd3fc;
  color: #0369a1;
  text-decoration: none;
  font-size: 13px;
}
.xy-todo-chip:hover {
  background: #f0f9ff;
  border-color: #0ea5e9;
}

.xy-notify-banner {
  background: linear-gradient(90deg, #0f766e, #0d9488);
  color: #fff;
  padding: 12px 0;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}
.xy-notify-banner .xy-inbox-urgent-inner { justify-content: center; text-align: center; }
.xy-notify-banner .btn {
  background: #fff;
  color: #0f766e;
  font-weight: 700;
}
.xy-notify-banner .btn:hover { background: #ecfdf5; color: #115e59; }
.xy-notify-banner .xy-inbox-urgent-sub { opacity: 0.95; font-size: 13px; }

/* 站内信强提醒（用户端） */
.xy-inbox-urgent {
  background: linear-gradient(90deg, #b91c1c, #dc2626);
  color: #fff;
  padding: 12px 0;
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.35);
  animation: xyInboxBarPulse 2s ease-in-out infinite;
}
.xy-inbox-urgent-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  justify-content: center;
  text-align: center;
}
.xy-inbox-urgent .btn {
  background: #fff;
  color: #b91c1c;
  font-weight: 700;
}
.xy-inbox-urgent .btn:hover { background: #fef2f2; color: #991b1b; }
.xy-inbox-urgent-sub { opacity: 0.95; font-size: 13px; }
@keyframes xyInboxBarPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}
.top a.nav-inbox-hot {
  color: #fecaca !important;
  font-weight: 700;
  animation: xyNavInboxBlink 1.2s ease-in-out infinite;
}
@keyframes xyNavInboxBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.inbox-title-unread { font-weight: 700; color: #b91c1c !important; }
.inbox-msg-card.inbox-msg-admin { border-left: 4px solid #64748b; }
.inbox-msg-body img { max-width: 100%; height: auto; }

/* 站内信 Quill */
.xy-inbox-quill-wrap { max-width: 100%; margin-bottom: 8px; }
.xy-inbox-quill-wrap .ql-toolbar.ql-snow {
  border-radius: 8px 8px 0 0;
  border-color: #cbd5e1;
  font-family: inherit;
}
.xy-inbox-quill-wrap .ql-container.ql-snow {
  border-radius: 0 0 8px 8px;
  border-color: #cbd5e1;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
.xy-inbox-quill-wrap .ql-editor {
  min-height: 160px;
  font-size: 14px;
  line-height: 1.6;
}
.xy-inbox-quill-wrap .ql-editor.ql-blank::before {
  font-style: normal;
  color: #94a3b8;
}

/* 工作台富文本说明（与后台 Quill 输出一致） */
.xy-workbench-rich {
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}
.xy-workbench-rich p { margin: 0 0 10px; }
.xy-workbench-rich p:last-child { margin-bottom: 0; }
.xy-workbench-rich ul, .xy-workbench-rich ol { margin: 8px 0; padding-left: 1.4em; }
.xy-workbench-rich img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  vertical-align: middle;
}
.xy-workbench-rich a { color: #0d9488; }
.xy-workbench-rich pre, .xy-workbench-rich code {
  font-size: 13px;
  background: #f1f5f9;
  border-radius: 4px;
}
.xy-workbench-rich pre { padding: 8px 10px; overflow: auto; }
.xy-workbench-rich code { padding: 1px 4px; }

/* 系统消息 / 站内信：子页内快速切换（顶栏仅站内信；系统消息经横幅等入口） */
.xy-msg-hub { box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.xy-msg-hub-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.xy-msg-hub-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
}
.xy-msg-hub-link.is-active {
  background: #0d9488;
  color: #fff;
  border-color: #0d9488;
  font-weight: 600;
}
.xy-msg-hub-link:not(.is-active):hover {
  background: #ccfbf1;
}
.xy-msg-hub-badge {
  display: inline-block;
  min-width: 1.25em;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #dc2626;
  color: #fff;
  line-height: 1.4;
}
.xy-msg-hub-link.is-active .xy-msg-hub-badge {
  background: rgba(255,255,255,0.28);
  color: #fff;
}

/* 我的任务：顶区两栏（日底薪 + 规则） */
.user-tasks-intro-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 8px;
}
@media (min-width: 768px) {
  .user-tasks-intro-grid {
    grid-template-columns: 1fr minmax(260px, 340px);
    gap: 20px;
  }
}
.user-tasks-intro-main h1 {
  margin-top: 0;
}
.user-tasks-salary-card {
  margin-bottom: 0;
  border-left: 4px solid #0d9488;
  padding: 14px 16px;
}
.user-tasks-salary-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: none;
  letter-spacing: 0.02em;
}
.user-tasks-salary-amount {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 10px;
}
.user-tasks-salary-label {
  width: 100%;
  font-size: 13px;
  color: #334155;
  font-weight: 600;
  line-height: 1.35;
}
.user-tasks-salary-num {
  font-size: 28px;
  line-height: 1.1;
  color: #0f766e;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.user-tasks-salary-unit {
  font-size: 15px;
  color: #64748b;
  font-weight: 600;
}
.user-tasks-salary-hint {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
}
.user-tasks-rules-list {
  margin: 0 0 12px;
  padding-left: 1.15em;
  font-size: 13px;
  line-height: 1.55;
}
.user-tasks-rules-list li {
  margin-bottom: 8px;
}
.user-tasks-rules-list li:last-child {
  margin-bottom: 0;
}
.user-tasks-rules-list strong {
  color: #334155;
}

/* 我的任务：桌面为表格，窄屏为卡片行，避免横向滚动遮挡 */
.user-tasks-wrap { overflow-x: auto; }
.table-user-tasks .td-xianyu { max-width: 120px; word-break: break-word; font-size: 13px; }
.table-user-tasks .td-note { max-width: 200px; font-size: 12px; word-break: break-word; }
@media (max-width: 720px) {
  .user-tasks-wrap { overflow-x: visible; margin: 0 -4px; }
  .table-user-tasks {
    display: block;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }
  .table-user-tasks thead { display: none; }
  .table-user-tasks tbody { display: block; }
  .table-user-tasks tbody tr.user-task-row {
    display: block;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    overflow: hidden;
  }
  .table-user-tasks tbody tr.user-task-row:last-child { margin-bottom: 0; }
  .table-user-tasks tbody tr.user-task-row td {
    display: block;
    border-bottom: 1px solid #e8eef4;
    padding: 10px 12px 10px 42%;
    text-align: right;
    position: relative;
    max-width: none !important;
    font-size: 14px;
  }
  .table-user-tasks tbody tr.user-task-row td:last-child { border-bottom: none; }
  .table-user-tasks tbody tr.user-task-row td::before {
    content: attr(data-label);
    position: absolute;
    left: 12px;
    top: 10px;
    width: 38%;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    line-height: 1.4;
  }
  .table-user-tasks tbody tr.user-task-empty td {
    display: block;
    width: 100%;
    text-align: center;
    padding: 20px 14px;
  }
  .table-user-tasks tbody tr.user-task-empty td::before {
    display: none !important;
  }
}

/* 顶栏：手机端换行与触控区域 */
@media (max-width: 720px) {
  .top .wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .top .brand { margin-right: 0; }
  .top nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.12);
    justify-content: flex-start;
  }
  .top nav a {
    margin-right: 0;
    font-size: 13px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
  }
  .top nav span.muted {
    width: 100%;
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.85;
  }
  .main { padding: 16px 12px 40px; }
}
