/* ============ zzproxy 管理后台 · 桌面端补丁（≥1024px） ============
   纯 CSS 覆盖层：手机端保持原样，只在大屏上生效。
   引用方式：在 admin.html <head> 里 panel.css 之后加
   <link rel="stylesheet" href="/assets/desktop-admin.css">            */

@media (min-width: 1024px) {

  /* ---------- 1. 页面底色与版心（1400px 居中） ---------- */
  body.wide {
    background: #F6F7FB;
    color: #1A1A2E;
  }
  body.wide header .header-inner,
  body.wide main#mainContent,
  body.wide footer.panel-foot {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 32px;
    padding-right: 32px;
    box-sizing: border-box;
  }
  body.wide main#mainContent {
    padding-top: 28px;
    padding-bottom: 64px;
  }

  /* ---------- 2. 顶部导航 sticky + 毛玻璃 ---------- */
  body.wide header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid #EBEDF3;
    box-shadow: 0 4px 20px rgba(25, 35, 80, 0.05);
  }
  body.wide header .header-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  body.wide .user-box {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  body.wide .user-box a {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid #E3E6EF;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #3A3A4A;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
  }
  body.wide .user-box a:hover {
    border-color: #0071E3;
    color: #0071E3;
  }
  body.wide .logout-btn {
    border-radius: 999px;
    padding: 8px 18px;
  }

  /* ---------- 3. 主区改为两列仪表盘 grid ---------- */
  body.wide main#mainContent {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
  }
  body.wide main#mainContent > h1 {
    grid-column: 1 / -1;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 4px 0 0;
  }
  body.wide main#mainContent > .sub {
    grid-column: 1 / -1;
    font-size: 14px;
    color: #6B7280;
    margin: -12px 0 6px;
  }
  /* 公告 / 统计 / 发货表单这类长区块独占整行 */
  body.wide main#mainContent > #announceCard,
  body.wide main#mainContent > #statsGrid,
  body.wide main#mainContent > .card:not(.ticket-compact-card) {
    grid-column: 1 / -1;
  }
  /* 功能入口卡片两列并排 */
  body.wide main#mainContent > .card.ticket-compact-card {
    margin: 0;
  }

  /* ---------- 4. 卡片高级化 ---------- */
  body.wide .card {
    background: #fff;
    border: 1px solid #EBEDF3;
    border-radius: 18px;
    box-shadow: 0 10px 32px rgba(25, 35, 80, 0.07);
    padding: 24px 26px;
  }
  body.wide .card h2 {
    font-weight: 800;
    letter-spacing: -0.01em;
  }
  body.wide .ticket-compact-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }
  body.wide .ticket-compact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(25, 35, 80, 0.11);
  }
  body.wide .ticket-compact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  body.wide .ticket-compact-sub {
    font-size: 13px;
    color: #6B7280;
  }

  /* ---------- 5. 统计卡片：4 列 grid ---------- */
  body.wide .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
  body.wide .stat-card {
    background: #fff;
    border: 1px solid #EBEDF3;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(25, 35, 80, 0.06);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }
  body.wide .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(25, 35, 80, 0.1);
  }
  body.wide .stat-num {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
  }
  body.wide .stat-label {
    font-size: 12.5px;
    color: #6B7280;
    margin-top: 2px;
  }
  body.wide .stat-card-icon {
    font-size: 26px;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #F1F5FF;
  }

  /* ---------- 6. 发货表单：3 列 grid ---------- */
  body.wide .grant-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 18px;
  }
  body.wide .grant-form > .full {
    grid-column: 1 / -1;
  }
  body.wide .grant-form label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: #4B5563;
    margin-bottom: 6px;
  }
  body.wide .grant-form input,
  body.wide .grant-form select {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #E5E7EB;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 14px;
  }
  body.wide .grant-form input:focus,
  body.wide .grant-form select:focus {
    outline: none;
    border-color: #0071E3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
  }

  /* ---------- 7. 按钮 pill 化 ---------- */
  body.wide .btn {
    border-radius: 999px;
    padding: 10px 24px;
    font-weight: 700;
    background: #0071E3;
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s;
  }
  body.wide .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0, 113, 227, 0.34);
  }
  body.wide .action-btn {
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 12.5px;
    font-weight: 700;
    border: 1px solid #DDE3F0;
    background: #fff;
    color: #374151;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
  }
  body.wide .action-btn:hover {
    border-color: #0071E3;
    color: #0071E3;
  }
  body.wide .action-btn.danger {
    border-color: #F3C2C2;
    color: #D33;
    background: #FFF7F7;
  }
  body.wide .action-btn.danger:hover {
    border-color: #D33;
    color: #D33;
    background: #FFECEC;
  }
  body.wide .action-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }

  /* ---------- 8. 状态徽标 pill 化 ---------- */
  body.wide .badge,
  body.wide .p-badge,
  body.wide .t-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
  }

  /* ---------- 9. 数据表格：sticky 表头 / hover / 大内边距 ---------- */
  body.wide .table-scroll {
    overflow: auto;
    max-height: 560px;
    border: 1px solid #EBEDF3;
    border-radius: 14px;
    background: #fff;
  }
  body.wide .table-scroll table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
  }
  body.wide .table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #F7F9FF;
    color: #4B5563;
    font-size: 12.5px;
    font-weight: 800;
    text-align: left;
    padding: 13px 18px;
    border-bottom: 1px solid #E7EBF5;
    white-space: nowrap;
  }
  body.wide .table-scroll tbody td {
    padding: 13px 18px;
    border-bottom: 1px solid #F0F2F8;
    vertical-align: middle;
    color: #1A1A2E;
  }
  body.wide .table-scroll tbody tr:last-child td {
    border-bottom: none;
  }
  body.wide .table-scroll tbody tr {
    transition: background 0.12s;
  }
  body.wide .table-scroll tbody tr:hover {
    background: #FAFAFE;
  }
  body.wide .table-scroll tbody tr.t-row-unread {
    background: #F5F9FF;
  }
  body.wide .table-scroll tbody tr.t-row-unread:hover {
    background: #EDF4FF;
  }
  body.wide .table-scroll td .action-btn {
    margin: 2px 4px 2px 0;
  }
  /* 公告列表内容列允许换行，其余列不换行更整齐 */
  body.wide .table-scroll tbody td {
    white-space: nowrap;
  }
  body.wide #announceListWrap .table-scroll tbody td:first-child {
    white-space: pre-wrap;
  }

  /* ---------- 10. 筛选行 ---------- */
  body.wide .filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
  }
  body.wide .filter-row input[type="text"],
  body.wide .filter-row select {
    border: 1.5px solid #E5E7EB;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13.5px;
  }
  body.wide .filter-row input[type="text"] {
    min-width: 260px;
    flex: 1;
  }
  body.wide .filter-row input:focus,
  body.wide .filter-row select:focus {
    outline: none;
    border-color: #0071E3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
  }

  /* ---------- 11. 弹窗加宽（覆盖行内 max-width 用 !important） ---------- */
  body.wide .modal-overlay .ticket-modal-box {
    width: min(880px, 94vw) !important;
    max-width: 880px !important;
    border-radius: 20px;
    border: 1px solid #EBEDF3;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
  }
  /* 数据密集的列表弹窗再宽一档 */
  body.wide #allSubsModal .ticket-modal-box,
  body.wide #ordersListModal .ticket-modal-box,
  body.wide #instancesListModal .ticket-modal-box,
  body.wide #instanceRequestsModal .ticket-modal-box {
    width: min(1060px, 96vw) !important;
    max-width: 1060px !important;
  }
  /* 工单/聊天详情弹窗：阅读区更宽 */
  body.wide #ticketModal .ticket-modal-box,
  body.wide #chatModal .ticket-modal-box {
    width: min(760px, 94vw) !important;
    max-width: 760px !important;
  }
  body.wide .ticket-modal-head {
    padding: 20px 28px;
    border-bottom: 1px solid #EEF0F6;
  }
  body.wide .ticket-modal-head h3 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
  }

  /* ---------- 12. 长列表内部滚动 ---------- */
  body.wide .modal-scroll-body {
    max-height: calc(82vh - 230px);
    min-height: 200px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body.wide .modal-scroll-body .table-scroll {
    max-height: none;
    border: none;
    border-radius: 0;
  }
  body.wide .ticket-thread {
    max-height: 52vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 28px;
  }
  body.wide .ticket-reply-area {
    padding: 16px 28px 20px;
    border-top: 1px solid #EEF0F6;
  }
  body.wide #announceCard .table-scroll {
    max-height: 340px;
  }

  /* ---------- 13. 公告发布区 ---------- */
  body.wide #announceContent {
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.7;
  }

  /* ---------- 14. 页脚 ---------- */
  body.wide footer.panel-foot {
    padding-top: 28px;
    padding-bottom: 40px;
    text-align: center;
    color: #9CA3AF;
    font-size: 12.5px;
  }
}
