/* ===== 任务发单平台 宝塔面板风格样式（响应式 · 专业版） ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* 品牌与功能色板 */
  --brand: #3b6cff;        /* 品牌主色（科技蓝） */
  --brand-2: #6a8dff;      /* 渐变浅 */
  --brand-dark: #2b4fd0;   /* 按下/深 */
  --brand-soft: rgba(59,108,255,.10);
  --danger: #ef4f56;
  --danger-soft: #fef0f1;
  --success: #16a06a;
  --success-soft: #ecf8f2;
  --warning: #e8850c;
  --warning-soft: #fff7e8;
  /* 侧栏 */
  --sb-bg: #151e2d;
  --sb-bg-2: #202b40;
  --sb-text: #9aa7bd;
  --sb-text-hover: #eef2ff;
  /* 内容 */
  --bg: #f4f6fa;
  --card: #ffffff;
  --border: #e5e9f2;
  --text: #1f2733;
  --muted: #7a8598;
  /* 尺寸与阴影 */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 2px 8px rgba(16,24,40,.04);
  --shadow-lg: 0 16px 40px rgba(16,24,40,.16);
  --ring: 0 0 0 3px rgba(59,108,255,.14);
}
html, body { font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", Roboto, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }

/* ===== 整体布局：左侧导航 + 右侧主区 ===== */
.layout { display: flex; min-height: 100vh; }

/* ---- 左侧导航 ---- */
.sidebar {
  width: 220px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30;
  background: linear-gradient(180deg, var(--sb-bg) 0%, var(--sb-bg-2) 100%);
}
.sidebar .logo {
  color: #fff; font-size: 15px; font-weight: 700; padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; gap: 9px;
  letter-spacing: .3px;
}
.sidebar .logo .dot {
  width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: 0 0 0 4px rgba(59,108,255,.16);
}
.sidebar nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 3px; }
.tab-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: none; border: none; color: var(--sb-text); padding: 12px 14px;
  font-size: 14px; cursor: pointer; text-align: left; border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0; transition: background .18s, color .18s;
}
.tab-item svg { flex-shrink: 0; opacity: .9; transition: opacity .18s; }
.tab-item .tab-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
}
.tab-item:hover { background: rgba(255,255,255,.07); color: var(--sb-text-hover); }
.tab-item.active {
  background: linear-gradient(90deg, rgba(59,108,255,.30) 0%, rgba(59,108,255,.08) 100%);
  color: #fff; border-left-color: var(--brand); font-weight: 600;
}

/* ---- 首页数据概览卡 ---- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 16px; text-align: center; box-shadow: var(--shadow);
}
.stat-card .stat-num { font-size: 30px; font-weight: 700; line-height: 1; }
.stat-card .stat-label { color: var(--muted); font-size: 13px; margin-top: 8px; }
.stat-blue  .stat-num { color: var(--brand); }
.stat-green .stat-num { color: var(--success); }
.stat-warn  .stat-num { color: var(--warning); }
.stat-red   .stat-num { color: var(--danger); }
.stat-purple .stat-num { color: #6b4fcf; }
.stat-orange .stat-num { color: #f97316; }

/* ---- 右侧主区 ---- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.topbar .page-title { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.topbar .user-box { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.topbar .user-box .uname { color: var(--text); font-weight: 600; }
.topbar .role-tag { background: var(--brand-soft); color: var(--brand); border-radius: 20px; padding: 3px 11px; font-size: 12px; font-weight: 500; }
.btn-logout { background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); padding: 6px 13px; font-size: 13px; cursor: pointer; transition: all .15s; }
.btn-logout:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }

/* ---- 内容区 ---- */
.content { padding: 24px; flex: 1; }
.panel { display: none; }
.panel.show { display: block; }

/* ---- 卡片 ---- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.card-title { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 16px; }
.card-title h3 { font-size: 16px; font-weight: 700; }
.card-title .tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---- 筛选条 ---- */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .filter-btn { background: #f4f6fa; border: 1px solid var(--border); color: var(--muted); padding: 7px 15px; font-size: 13px; border-radius: var(--radius-sm); cursor: pointer; transition: all .15s; }
.filter-bar .filter-btn:hover { color: var(--brand); border-color: var(--brand); }
.filter-bar .filter-btn.active { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); border-color: transparent; color: #fff; box-shadow: 0 2px 6px rgba(59,108,255,.28); }

/* ---- 表单 ---- */
.form-row { margin-bottom: 15px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
input[type=text], input[type=password], input[type=search], textarea, select {
  width: 100%; padding: 10px 12px; font-size: 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: #fafbfe; color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); background: #fff; }
input::placeholder, textarea::placeholder { color: #c2c9d6; }

/* ---- 按钮 ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: none; border-radius: var(--radius-sm); padding: 9px 16px; font-size: 14px; font-weight: 500; cursor: pointer; min-height: 38px; transition: all .16s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.is-loading { opacity: .7; cursor: progress; pointer-events: none; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; box-shadow: 0 2px 6px rgba(59,108,255,.26); }
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-2), var(--brand)); transform: translateY(-1px); box-shadow: 0 5px 12px rgba(59,108,255,.32); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.05); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { filter: brightness(1.05); }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.btn-sm { padding: 5px 11px; font-size: 13px; min-height: 30px; }
.btn-xs { padding: 3px 9px; font-size: 12px; min-height: 26px; }
.btn-block { width: 100%; }

/* ---- 表格 ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: #8a94a6; font-weight: 600; font-size: 12.5px; background: #f8fafc; white-space: nowrap; }
tr:hover td { background: #f7f9fd; }
tr.clickable { cursor: pointer; }
td .muted { color: var(--muted); font-size: 12px; }
td .title-cell { font-weight: 500; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 订单列表：平台账号列（账号在上、昵称在下，禁止换行） */
td.account-cell { white-space: nowrap; }
td.account-cell .muted { font-size: 12px; }
/* 订单列表：批量结单勾选列 */
th.check-cell, td.check-cell { width: 38px; padding-right: 0; }
th.check-cell input, td.check-cell input { width: auto; margin: 0; cursor: pointer; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- 标签（pill） ---- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; white-space: nowrap; font-weight: 500; }
.badge-blue { background: var(--brand-soft); color: var(--brand); }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-orange { background: var(--warning-soft); color: var(--warning); }
.badge-gray { background: #f2f3f6; color: var(--muted); }
.badge-purple { background: #f3f1fe; color: #6b4fcf; }

/* ---- 分页 ---- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 0 4px; flex-wrap: wrap; }
.pagination .info { font-size: 13px; color: var(--muted); }

/* ---- 公告 ---- */
.announce { display: flex; gap: 12px; padding: 15px 6px; border-bottom: 1px solid var(--border); transition: background .15s; }
.announce:last-child { border-bottom: none; }
.announce:hover { background: #fafbfe; }
.announce .pin { color: var(--warning); font-size: 13px; flex-shrink: 0; font-weight: 600; }
.announce .body { flex: 1; }
.announce .body .t { font-weight: 600; font-size: 15px; }
.announce .body .c { color: var(--muted); font-size: 13px; margin-top: 5px; white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.announce .time { color: #c2c9d6; font-size: 12px; margin-top: 8px; }
/* 长公告折叠（默认最多 4 行） */
.announce .body .c.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ann-toggle { background: none; border: none; padding: 0; margin-top: 6px; color: var(--brand); font-size: 12px; cursor: pointer; }
.ann-toggle:hover { text-decoration: underline; }

/* ---- 空状态（友好化） ---- */
.empty { text-align: center; color: var(--muted); padding: 48px 0; font-size: 14px; }
.empty .empty-icon { color: #c8cfdb; display: block; margin: 0 auto 14px; }
.empty p { color: var(--muted); }

/* ---- 列表加载中 ---- */
.loading-box { text-align: center; color: var(--muted); padding: 36px 0; font-size: 13px; }

/* ---- 模态框 ---- */
.modal-mask { position: fixed; inset: 0; background: rgba(21,30,45,.5); display: none; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: var(--radius); width: 100%; max-width: 520px; padding: 22px; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal .modal-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 16px; }
.modal .modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; transition: color .15s; }
.modal-close:hover { color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ---- 自定义确认弹窗 ---- */
.modal-confirm { max-width: 400px; }
.confirm-body { display: flex; gap: 14px; align-items: flex-start; padding: 6px 2px 4px; }
.confirm-icon { flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); display: flex; align-items: center; justify-content: center; }
.confirm-body p { font-size: 14px; line-height: 1.7; color: var(--text); word-break: break-word; }

/* ---- 订单详情条目列表（每行带复制按钮） ---- */
.detail-meta { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.9; }
.detail-meta b { color: var(--text); font-weight: 600; }
.item-list { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.item-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.item-row:last-child { border-bottom: none; }
.item-row:hover { background: #f7f9fd; }
.item-num { flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.item-text { flex: 1; font-size: 14px; word-break: break-word; line-height: 1.6; }
/* 条目主体：要求 + 链接 */
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item-body .item-text { flex: none; }
.item-link { font-size: 12.5px; word-break: break-all; line-height: 1.5; }

/* ---- 发布订单：动态内容行 ---- */
.item-input-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.item-input-row input { flex: 1; min-width: 0; }
.item-input-row .del-row { flex-shrink: 0; }
.add-row { margin-top: 2px; }

/* ---- Toast ---- */
#toast { position: fixed; left: 50%; top: 22px; transform: translateX(-50%); background: #1c2431; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90%; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
#toast.show { opacity: 1; }
#toast.ok { background: var(--success); }
#toast.err { background: var(--danger); }

/* ---- 登录页 ---- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(135deg, #141c2b 0%, #233048 55%, #1d2a40 100%); }
.login-card { background: #fff; border-radius: 14px; padding: 34px 30px; width: 100%; max-width: 380px; box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.login-card .logo-bar { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
.login-card .logo-bar .dot { width: 15px; height: 15px; border-radius: 4px; background: linear-gradient(135deg, var(--brand-2), var(--brand)); box-shadow: 0 0 0 4px rgba(59,108,255,.14); }
.login-card h1 { font-size: 20px; text-align: center; letter-spacing: .5px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 24px; }
#loginMsg { margin-top: 12px; text-align: center; font-size: 13px; color: var(--danger); min-height: 18px; }

/* ---- 公开订单页（分享链接） ---- */
.public-page {
  min-height: 100vh; padding: 32px 16px; display: flex; justify-content: center; align-items: flex-start;
  background: linear-gradient(135deg, #141c2b 0%, #233048 55%, #1d2a40 100%);
}
.public-wrap { width: 100%; max-width: 640px; }
.public-card { background: #fff; border-radius: 14px; padding: 26px 24px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.public-card .pub-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.public-card .pub-logo .dot {
  width: 13px; height: 13px; border-radius: 4px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-2), var(--brand)); box-shadow: 0 0 0 4px rgba(59,108,255,.14);
}
.public-card .pub-logo h1 { font-size: 16px; letter-spacing: .3px; }
.public-title { font-size: 20px; font-weight: 700; margin-bottom: 10px; word-break: break-word; }
.public-meta { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.public-note {
  background: var(--warning-soft); color: #9a5b00; border: 1px solid #f6dcb4;
  border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; line-height: 1.7;
}
.public-actions { margin-top: 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.public-actions .hint { color: var(--muted); font-size: 13px; }
.public-state { margin-top: 18px; padding: 12px; border-radius: 8px; text-align: center; font-size: 13px; }
.public-state.ok { background: var(--success-soft); color: var(--success); }
.public-state.wait { background: var(--warning-soft); color: #9a5b00; }
/* 提交表单：平台账号 / 昵称 */
.public-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.public-form .form-row { margin-bottom: 12px; }
.public-form label .req { color: var(--danger); }
.public-info { margin-top: 18px; padding: 12px 14px; border-radius: 8px; background: #f7f9fd; font-size: 13px; }
.public-info div { display: flex; gap: 10px; padding: 3px 0; }
.public-info .k { color: var(--muted); min-width: 66px; }
.public-info .v { color: var(--text); font-weight: 600; word-break: break-all; }
@media (max-width: 480px) {
  .public-page { padding: 16px 10px; }
  .public-card { padding: 20px 16px; }
}

/* ---- 小屏（手机）适配：导航转为顶部横滑 ---- */
@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: sticky; top: 0; background: var(--sb-bg-2); }
  .sidebar .logo { display: none; }
  .sidebar nav { display: flex; padding: 0 4px; flex-direction: row; gap: 0; }
  /* 等宽分布、图标在上文字在下（App 底部 Tab 栏式），全部显示无需横滑 */
  .tab-item {
    flex: 1; min-width: 0; flex-direction: column; gap: 4px;
    border-left: none; border-bottom: 3px solid transparent; border-radius: 0;
    padding: 9px 4px 7px; white-space: nowrap; font-size: 12px; position: relative;
  }
  .tab-item .tab-badge { position: absolute; top: 2px; right: 6px; margin-left: 0; }
  .tab-item.active { border-bottom-color: var(--brand); background: rgba(59,108,255,.16); }
  .content { padding: 14px; }
  .card { padding: 15px; }
  /* 顶栏：高度自适应 + 不再吸顶（侧栏已吸顶，避免两者重叠）；右侧用户区允许换行 */
  .topbar { height: auto; min-height: 54px; padding: 6px 14px; position: static; gap: 8px; }
  .topbar .page-title { font-size: 15px; flex-shrink: 0; }
  .topbar .user-box { gap: 6px; font-size: 12px; flex-wrap: wrap; justify-content: flex-end; }
  .topbar .user-box .uname { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn-logout { padding: 5px 9px; font-size: 12px; }
  .btn { min-height: 40px; }
  .btn-group .btn { margin-bottom: 4px; }
  /* 筛选按钮多时横向滑动，避免换行挤压变形 */
  .filter-bar { gap: 8px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-bar .filter-btn { flex: 0 0 auto; white-space: nowrap; }
  /* 卡片标题区允许换行，搜索框在手机上占满一行 */
  .card-title { flex-wrap: wrap; gap: 10px; }
  .card-title .tools { width: 100%; }
  .card-title .tools input[type=search] { max-width: none !important; flex: 1; min-width: 0; }
  /* 公告操作按钮在窄屏换行到内容下方 */
  .announce { flex-wrap: wrap; }
  .announce .btn-group { width: 100%; justify-content: flex-end; }

  /* ---- 移动端表格转卡片（触屏友好） ---- */
  .table-wrap { overflow: visible; }
  table, thead, tbody, tr, td { display: block; }
  thead { display: none; }
  table { min-width: 0; }
  tbody { display: flex; flex-direction: column; gap: 12px; }
  tbody tr {
    display: block; background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(16,24,40,.04);
  }
  tbody tr.clickable:hover td { background: transparent; }
  tbody td {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 4px 12px; padding: 8px 2px; border-bottom: none;
  }
  tbody td::before {
    content: attr(data-label); flex-shrink: 0;
    color: var(--muted); font-size: 12px; font-weight: 500;
  }
  tbody td .title-cell { max-width: none; white-space: normal; }
  tbody td .muted { white-space: normal; }
  tbody td .btn-group { justify-content: flex-end; width: 100%; }
  tbody td .btn-group .btn { flex: 1; margin-bottom: 0; }
  /* 空状态/加载中整行：移动端去掉卡片样式与列标签 */
  tbody tr.empty-row, tbody tr.loading-row { border: none; box-shadow: none; background: transparent; padding: 0; }
  tbody tr.empty-row td, tbody tr.loading-row td { display: block; padding: 0; }
  tbody tr.empty-row td::before, tbody tr.loading-row td::before { content: none; }
}
