/* ===== 桁北商事送达云 公共样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #1e3a5f;
    --primary-2: #2c5f8a;
    --primary-3: #3d7db3;
    --accent: #c9a227;
    --bg: #f2f4f8;
    --card: #ffffff;
    --text: #2b3545;
    --muted: #7a8798;
    --border: #e3e8ef;
    --success: #1f9d63;
    --info: #2f6fb0;
    --danger: #d54545;
    --warning: #d98a1f;
}
body { font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--primary-2); text-decoration: none; }
a:hover { color: var(--primary-3); }

/* ===== 登录页 ===== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #16283f 0%, #1e3a5f 55%, #2c5f8a 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.login-wrap::before, .login-wrap::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
}
.login-wrap::before { width: 520px; height: 520px; top: -180px; right: -140px; }
.login-wrap::after { width: 420px; height: 420px; bottom: -160px; left: -120px; }
.login-card {
    width: 420px; max-width: 100%;
    background: #fff; border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    overflow: hidden; position: relative; z-index: 2;
}
.login-head { padding: 34px 36px 8px; text-align: center; }
.login-head .logo-title { font-size: 26px; font-weight: 700; color: var(--primary); letter-spacing: 2px; }
.login-head .logo-sub { margin-top: 6px; color: var(--accent); font-size: 15px; letter-spacing: 6px; font-weight: 600; }
.login-head .sys-title { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); font-size: 13px; color: var(--muted); }
.login-body { padding: 20px 36px 30px; }
.login-body .form-item { margin-bottom: 16px; }
.login-body label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.login-body .input {
    width: 100%; height: 42px; padding: 0 14px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; outline: none; transition: border .2s;
}
.login-body .input:focus { border-color: var(--primary-3); box-shadow: 0 0 0 3px rgba(61,125,179,.12); }
.btn {
    display: inline-block; border: none; cursor: pointer; font-size: 14px;
    border-radius: 8px; padding: 10px 22px; transition: all .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-block { width: 100%; display: block; height: 44px; font-size: 15px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { background: #26609c; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #18824f; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b83434; }
.btn-gray { background: #eef1f5; color: var(--text); }
.btn-gray:hover { background: #e0e5ec; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.login-tip { margin-top: 14px; text-align: center; font-size: 12px; color: var(--muted); }
.form-error {
    background: #fdecec; color: #b02a2a; border: 1px solid #f5c2c2;
    padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px;
}
.step2-info {
    background: #eef5fc; border: 1px solid #cfe3f5; color: var(--primary-2);
    padding: 12px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; line-height: 1.7;
}
.code-row { display: flex; gap: 10px; }
.code-row .input { flex: 1; }
.code-row .btn { height: 42px; white-space: nowrap; }

/* ===== 后台框架 ===== */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 232px; background: #17283c; color: #c7d3e0; flex-shrink: 0;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
    z-index: 200; transition: transform .25s ease;
}
.sidebar-overlay {
    position: fixed; inset: 0; background: rgba(15,25,40,.5); z-index: 190;
    display: none; opacity: 0; transition: opacity .25s ease;
}
.sidebar .brand { padding: 22px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand .b1 { color: #fff; font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.sidebar .brand .b2 { color: var(--accent); font-size: 12px; letter-spacing: 3px; margin-top: 4px; }
.sidebar nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar nav .nav-group { padding: 14px 20px 6px; font-size: 12px; color: #5f749a; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: #c7d3e0;
    font-size: 14px; border-left: 3px solid transparent; transition: all .15s;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: rgba(61,125,179,.22); color: #fff; border-left-color: var(--accent); }
.sidebar nav a .ico { width: 18px; text-align: center; font-size: 15px; opacity: .9; }
.sidebar .sidebar-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #5f749a; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 0 26px; height: 62px; display: flex; align-items: center; justify-content: space-between; }
.topbar .topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar .page-title { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn {
    display: none; background: none; border: 1px solid var(--border); border-radius: 8px;
    width: 38px; height: 38px; font-size: 18px; line-height: 1; cursor: pointer; color: var(--primary);
    align-items: center; justify-content: center; flex-shrink: 0; padding: 0;
}
.menu-btn:hover { background: #f0f4f9; }
.topbar .user-box { display: flex; align-items: center; gap: 12px; }
.topbar .user-box .uname { font-size: 13px; color: var(--text); }
.topbar .user-box .urole { font-size: 12px; color: var(--muted); }
.content { padding: 24px 26px; flex: 1; }
.content-inner { max-width: 1200px; }
.page-desc { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ===== 卡片 / 统计 ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px 22px; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(20,40,70,.05); }
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--primary); margin-top: 6px; }
.stat-card .lbl { font-size: 13px; color: var(--muted); }
.stat-card .num small { font-size: 15px; color: var(--muted); font-weight: 400; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(20,40,70,.05); }
.card .card-head { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.card .card-head h3 { font-size: 15px; color: var(--text); }
.card .card-body { padding: 20px 22px; }
.card .card-body.no-pad { padding: 0; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.tbl th { background: #f7f9fc; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tbl tbody tr:hover { background: #fafbfd; }
.tbl td .sub { color: var(--muted); font-size: 12px; }

/* ===== 徽标 ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; line-height: 1.6; }
.badge-default { background: #eef1f5; color: #5c6b7d; }
.badge-info { background: #e4eef9; color: var(--info); }
.badge-success { background: #e3f5ec; color: var(--success); }
.badge-warning { background: #fdf0dd; color: var(--warning); }
.badge-danger { background: #fbe7e7; color: var(--danger); }

/* ===== 表单 ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item label { display: block; margin-bottom: 6px; color: var(--text); font-size: 13px; font-weight: 500; }
.form-item .req { color: var(--danger); margin-left: 2px; }
.input, textarea.input, select.input {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; outline: none; background: #fff; font-family: inherit;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--primary-3); box-shadow: 0 0 0 3px rgba(61,125,179,.1); }
.input[readonly] { background: #f5f7fa; color: var(--muted); }
.form-item .hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.6; }
.form-actions { margin-top: 22px; display: flex; gap: 10px; }
.upload-box {
    border: 2px dashed var(--border); border-radius: 10px; padding: 18px;
    background: #fafbfd; text-align: center; color: var(--muted); cursor: pointer;
    transition: all .2s;
}
.upload-box:hover { border-color: var(--primary-3); background: #f2f7fc; }
.file-list { margin-top: 10px; }
.file-item { display: flex; align-items: center; justify-content: space-between; background: #f7f9fc; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; font-size: 13px; }
.file-item .fname { display: flex; align-items: center; gap: 6px; }
.file-item .fname .rm { color: var(--danger); cursor: pointer; margin-left: 8px; }

/* ===== 分页 ===== */
.pagination { display: flex; gap: 6px; padding: 16px 22px; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; color: var(--text); background: #fff; }
.pagination a:hover { border-color: var(--primary-3); color: var(--primary-3); }
.pagination span.current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== 筛选条 ===== */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-bar .input { width: auto; min-width: 150px; }
.filter-bar .input.wide { width: 220px; }

/* ===== 提示 ===== */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; line-height: 1.7; }
.alert-success { background: #e3f5ec; color: #155f3c; border: 1px solid #b9e6cf; }
.alert-danger { background: #fbe7e7; color: #8f2323; border: 1px solid #f2c4c4; }
.alert-info { background: #e4eef9; color: #1d4f7e; border: 1px solid #c3dcf2; }
.alert-warning { background: #fdf0dd; color: #7a5410; border: 1px solid #f4d9a8; }

/* ===== 详情 ===== */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0; }
.detail-item { padding: 12px 0; border-bottom: 1px dashed var(--border); margin-right: 24px; }
.detail-item .k { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.detail-item .v { font-size: 14px; color: var(--text); word-break: break-all; }
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; background: #fafbfd; }
.doc-row .doc-ico { font-size: 22px; width: 34px; text-align: center; }
.doc-row .doc-name { flex: 1; font-size: 14px; font-weight: 500; word-break: break-all; }
.doc-row .doc-meta { color: var(--muted); font-size: 12px; }
.doc-row .doc-actions a { margin-left: 10px; }
.empty { text-align: center; color: var(--muted); padding: 46px 20px; font-size: 14px; }

/* ===== 用户文书查看页 ===== */
.doc-page { min-height: 100vh; background: #f2f4f8; }
.doc-page .doc-header {
    background: linear-gradient(135deg, #16283f 0%, #1e3a5f 60%, #2c5f8a 100%);
    color: #fff; text-align: center; padding: 42px 20px 34px;
}
.doc-page .doc-header .dh-title { font-size: 24px; font-weight: 700; letter-spacing: 6px; }
.doc-page .doc-header .dh-sub { margin-top: 8px; font-size: 13px; letter-spacing: 2px; opacity: .85; }
.doc-page .doc-body { max-width: 760px; margin: 26px auto; padding: 0 16px 60px; }
.doc-panel { background: #fff; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(20,40,70,.06); overflow: hidden; }
.doc-panel .dp-head { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.doc-panel .dp-head .dp-title { font-size: 15px; font-weight: 600; }
.doc-panel .dp-body { padding: 20px 22px; }
.doc-panel .dp-notice { background: #eef5fc; border: 1px solid #d2e5f7; color: #1d4f7e; border-radius: 8px; padding: 12px 16px; font-size: 13px; line-height: 1.8; margin-bottom: 18px; }

/* ===== 首页宣传页 ===== */
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.landing .land-nav {
    background: linear-gradient(135deg, #16283f 0%, #1e3a5f 60%, #2c5f8a 100%);
    color: #fff; padding: 18px 40px; display: flex; align-items: center; justify-content: space-between;
}
.landing .land-nav .brand { font-size: 20px; font-weight: 700; letter-spacing: 3px; }
.landing .land-nav .brand small { font-size: 12px; letter-spacing: 2px; opacity: .8; display: block; margin-top: 2px; }
.landing .land-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; }
.landing .land-box { max-width: 720px; }
.landing .land-box .icon { font-size: 64px; margin-bottom: 18px; }
.landing .land-box h1 { font-size: 30px; color: var(--primary); letter-spacing: 4px; }
.landing .land-box .line { width: 60px; height: 3px; background: var(--accent); margin: 20px auto; border-radius: 2px; }
.landing .land-box .desc { color: #44536a; font-size: 16px; line-height: 1.9; }
.landing .land-box .desc strong { color: var(--primary-2); }
.landing .land-foot { text-align: center; padding: 20px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); background: #fff; }

/* ===== 弹窗 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(20,30,45,.55); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal .modal-head { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal .modal-head h3 { font-size: 15px; }
.modal .modal-head .close { cursor: pointer; font-size: 20px; color: var(--muted); }
.modal .modal-body { padding: 20px 22px; }
.modal .modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ===== 响应式（移动端适配） ===== */
@media (min-width: 901px) {
    .menu-btn { display: inline-flex; }
}
@media (max-width: 900px) {
    /* ---- 侧边栏抽屉 ---- */
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; height: 100%; width: 240px;
        transform: translateX(-105%); box-shadow: 4px 0 20px rgba(0,0,0,.25); overflow-y: auto;
    }
    .app.sidebar-open .sidebar { transform: translateX(0); }
    .app.sidebar-open .sidebar-overlay { display: block; opacity: 1; }
    .sidebar .brand .b1, .sidebar .brand .b2, .sidebar nav a span { display: block; }
    .sidebar nav a { justify-content: flex-start; padding: 12px 20px; }
    .menu-btn { display: inline-flex; }

    /* ---- 顶栏 ---- */
    .topbar { padding: 0 12px; height: 54px; }
    .topbar .page-title { font-size: 15px; max-width: 46vw; }
    .topbar .user-box { gap: 8px; }
    .topbar .user-box .urole { display: none; }
    .topbar .user-box .uname { font-size: 12px; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* ---- 内容区 ---- */
    .content { padding: 16px 12px; }
    .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-card .num { font-size: 22px; }
    .card .card-head { padding: 12px 14px; }
    .card .card-body { padding: 14px; }
    .form-grid { grid-template-columns: 1fr; gap: 12px; }
    .form-actions { flex-wrap: wrap; }
    .form-actions .btn { flex: 1; }

    /* ---- 筛选条 ---- */
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .input { width: 100%; min-width: 0; }
    .filter-bar .input.wide { width: 100%; }
    .filter-bar .btn { width: 100%; }

    /* ---- 表格卡片化 ---- */
    .table-wrap { overflow: visible; }
    table.tbl { display: block; }
    .tbl thead { display: none; }
    .tbl tbody { display: block; padding: 12px; }
    .tbl tbody tr {
        display: block; border: 1px solid var(--border); border-radius: 10px;
        margin-bottom: 12px; background: #fff; box-shadow: 0 1px 3px rgba(20,40,70,.05);
    }
    .tbl tbody tr:last-child { margin-bottom: 0; }
    .tbl tbody tr:hover { background: #fff; }
    .tbl td {
        display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
        border-bottom: 1px dashed var(--border); padding: 10px 14px;
    }
    .tbl td:last-child { border-bottom: none; }
    .tbl td::before {
        content: attr(data-label); color: var(--muted); font-size: 12px;
        min-width: 64px; flex: 0 0 auto;
    }
    .tbl td .sub { display: block; }
    .tbl td form { display: inline-flex; gap: 10px; align-items: center; }
    .tbl td:last-child { flex-wrap: wrap; }

    /* ---- 分页 ---- */
    .pagination { flex: 1; justify-content: flex-end; padding: 12px 4px; gap: 6px; }
    .pagination a, .pagination span { padding: 6px 10px; font-size: 12px; }
    .pg-wrap { flex-wrap: wrap; }

    /* ---- 模态框 ---- */
    .modal-mask { padding: 12px; align-items: flex-end; }
    .modal { max-height: 92vh; border-radius: 12px 12px 0 0; }
    .modal .modal-head, .modal .modal-body { padding: 14px 16px; }
    .modal .modal-foot { padding: 12px 16px; }
    .modal .modal-foot .btn { flex: 1; }

    /* ---- 登录页 ---- */
    .login-wrap { padding: 14px; }
    .login-head { padding: 26px 22px 4px; }
    .login-body { padding: 16px 22px 24px; }
    .login-head .logo-title { font-size: 22px; }
    .login-head .logo-sub { letter-spacing: 4px; }
    .code-row .btn { flex-shrink: 0; }

    /* ---- 首页宣传页 ---- */
    .landing .land-nav { padding: 14px 18px; }
    .landing .land-nav .brand { font-size: 17px; letter-spacing: 1px; }
    .landing .land-nav .land-nav-side { display: none; }
    .landing .land-main { padding: 40px 16px; }
    .landing .land-box h1 { font-size: 24px; }
    .landing .land-box .icon { font-size: 48px; }
    .landing .land-box .desc { font-size: 14px; }

    /* ---- 文书查看页 ---- */
    .doc-page .doc-header { padding: 30px 16px 24px; }
    .doc-page .doc-header .dh-title { font-size: 20px; letter-spacing: 3px; }
    .doc-body { margin: 18px auto 40px; }
    .doc-panel .dp-head { padding: 12px 14px; flex-direction: column; align-items: flex-start; gap: 8px; }
    .doc-panel .dp-body { padding: 14px; }
    .doc-row { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
    .doc-row .doc-name { flex: 1 1 100%; order: 2; }
    .doc-row .doc-meta { order: 3; }
    .doc-row .doc-actions { order: 4; margin-left: auto; }

    /* ---- 详情页 ---- */
    .detail-item { margin-right: 0; }
}
@media (min-width: 901px) {
    .menu-btn { display: none; }
    .sidebar-overlay { display: none !important; }
}
