* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
       background: #f0f2f5; color: #333; }
a { color: #2d6cdf; text-decoration: none; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: #1f2d3d; color: #cfd8e3;
           display: flex; flex-direction: column; }
.brand { padding: 18px 16px; font-size: 16px; font-weight: bold;
         color: #fff; border-bottom: 1px solid #2a3b4e; }
.sidebar nav { flex: 1; padding: 8px 0; }
.sidebar nav a { display: block; padding: 11px 18px; color: #cfd8e3;
                 border-radius: 6px; margin: 2px 8px; }
.sidebar nav a:hover { background: #2a3b4e; }
.sidebar nav a.on { background: #2d6cdf; color: #fff; }
.side-foot { padding: 14px 18px; border-top: 1px solid #2a3b4e;
             font-size: 13px; }
.side-foot a { color: #8ab4f8; }
.content { flex: 1; padding: 20px 24px; }

/* 头部/工具栏 */
.page-head { display: flex; align-items: center; justify-content: space-between;
             margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.page-head h2 { font-size: 20px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 模块标签栏（对齐桌面版页内标签） */
.mod-tabs { display: flex; gap: 2px; border-bottom: 2px solid #e8e8e8;
            margin-bottom: 16px; flex-wrap: wrap; }
.mod-tabs a { padding: 9px 16px; color: #555; font-size: 14px;
              border-bottom: 2px solid transparent; margin-bottom: -2px; }
.mod-tabs a:hover { color: #2d6cdf; background: #f5f8ff; }
.mod-tabs a.on { color: #2d6cdf; font-weight: 600;
                 border-bottom-color: #2d6cdf; background: #f5f8ff; }

/* 来源标签（跨境电商对接：ERP销售订单/ERP待生产订单/ERP待采购订单） */
.src-tags { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.src-tags .btn.sm { border: 1px solid #e2e8f0; background: #f8fafc; color: #475569;
                    border-radius: 20px; padding: 5px 15px; font-size: 13px; }
.src-tags .btn.sm:hover { border-color: #2d6cdf; color: #2d6cdf; }
.src-tags .src-on { background: linear-gradient(135deg, #2d6cdf, #4da3ff);
                    color: #fff; border-color: transparent;
                    box-shadow: 0 2px 8px rgba(45,108,223,.35); }
.src-tags .src-on:hover { color: #fff; }
.tag.eb { display: inline-block; background: #e8f1ff; color: #2d6cdf;
          padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.tag.selfmade { display: inline-block; background: #e6f7ed; color: #1a7f37;
                padding: 2px 10px; border-radius: 12px; font-size: 12px; }

/* 按钮/表单 */
.btn { display: inline-block; padding: 7px 14px; border: 1px solid #ccc;
       border-radius: 6px; background: #fff; color: #333; cursor: pointer;
       font-size: 14px; }
.btn:hover { background: #f0f0f0; }
.btn.primary { background: #2d6cdf; border-color: #2d6cdf; color: #fff; }
.btn.primary:hover { background: #1f56b8; }
.btn.block { display: block; width: 100%; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.row-actions { white-space: nowrap; }
.row-actions form { display: inline; }
.frow { margin-bottom: 14px; }
.frow label { display: block; margin-bottom: 6px; color: #555; font-size: 14px; }
.frow input, .frow select, .frow textarea { width: 100%; padding: 9px 10px;
       border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
.inline { display: inline-flex; gap: 8px; align-items: center; }
.inline input[type=text] { padding: 7px 10px; border: 1px solid #ccc;
       border-radius: 6px; font-size: 14px; }
.domain-input { display: flex; align-items: center; gap: 6px; }
.domain-input input { width: 200px !important; }
.domain-box { padding: 9px 12px; background: #f7f9fc; border: 1px solid #e2e8f0;
              border-radius: 6px; }
.hint { color: #888; font-size: 13px; margin: 10px 0; line-height: 1.6; }
.card-form { background: #fff; padding: 18px; border-radius: 10px;
             border: 1px solid #e8e8e8; margin-bottom: 18px; max-width: 560px; }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; background: #fff;
       border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.tbl th { background: #f5f7fa; text-align: left; padding: 10px 12px;
          font-size: 13px; white-space: nowrap; }
.tbl td { padding: 9px 12px; border-top: 1px solid #f0f0f0; font-size: 14px; }
.tbl tr:hover td { background: #fafcff; }
.tbl .empty { text-align: center; color: #999; }
.warn { color: #e60000; font-weight: bold; }

/* 驾驶舱卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
         gap: 14px; margin-bottom: 22px; }
.card { background: #fff; border-radius: 10px; padding: 16px;
        border: 1px solid #e8e8e8; }
.card .k { color: #888; font-size: 13px; }
.card .v { font-size: 24px; font-weight: bold; margin-top: 8px; color: #2d6cdf; }
.card .v.warn { color: #fa8c16; }
h3 { margin: 16px 0 10px; font-size: 16px; }

/* 提示消息 */
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }
.flash.ok { background: #e6f7ed; color: #1a7f37; }
.flash.err { background: #fdecec; color: #c62828; }

/* 认证页 */
.auth-page { display: flex; align-items: center; justify-content: center;
             min-height: 100vh; background: linear-gradient(135deg,#1f2d3d,#2d6cdf); }
.auth-card { width: 400px; background: #fff; border-radius: 12px;
             padding: 30px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.auth-card h1 { text-align: center; font-size: 22px; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: #888; margin-bottom: 18px; }

/* AI */
.ai-layout { display: flex; gap: 18px; flex-wrap: wrap; }.ai-status { background: #fff; border: 1px solid #e8e8e8; border-radius: 10px;
             padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.ai-status code { background: #f5f7fa; padding: 2px 6px; border-radius: 4px; }
.ai-answer { margin-top: 14px; padding: 14px; background: #f7f9fc;
             border-radius: 8px; line-height: 1.7; }
.ai-a { white-space: normal; }
.ai-meta { color: #999; font-size: 12px; margin-top: 8px; }
.agent { padding: 10px 0; border-bottom: 1px solid #f2f2f2; font-size: 14px; }
.agent:last-child { border-bottom: none; }

/* 分页 */
.pager { margin-top: 14px; display: flex; align-items: center; gap: 10px;
         font-size: 13px; color: #666; }
.pager select { padding: 5px 8px; border: 1px solid #ccc; border-radius: 6px; }

/* 角色权限 */
.perms { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.perm { font-size: 14px; cursor: pointer; }
.perm input { margin-right: 4px; }
