body {
    background: #eafaf1;
}
.card {
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 128, 0, 0.1);
    background: #ffffff;
}
.form-control {
    border-radius: 10px;
    border: 2px solid #78c2ad;
}
.btn-success {
    background: #78c2ad;
    border-radius: 8px;
    border: none;
    transition: 0.3s;
    font-size: 1.1rem;
}
.btn-success:hover {
    background: #14a77d;
}
.btn-outline-success:hover {
    background-color: #78c2ad !important;
    color: white !important;
    border-color: #78c2ad !important;
}
h2 {
    font-size: 2.2rem;
    font-weight: bold;
    color: #14a77d;
    text-align: center;
    padding: 15px;
    background: rgba(120, 194, 173, 0.2);
    border-radius: 10px;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0, 128, 0, 0.1);
    letter-spacing: 1px;
}
.table {
    background-color: #f8fff0 !important;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 128, 0, 0.08);
    table-layout: auto;
    word-break: break-all;
}
.table th, .table td {
    border: 1px solid #c2e2d0 !important;
    padding: 10px;
    vertical-align: middle;
    font-size: 1rem;
    word-break: break-word;
}
.table th {
    background: #78c2ad !important;
    color: #fff !important;
}
.table-hover tbody tr:hover {
    background: #e3f8ff !important;
}
caption {
    text-align: left;
    margin: 10px 0;
    color: #999;
    font-size: 1em;
}
td a {
    color: #2fa36b !important;
    text-decoration: underline;
    font-weight: 500;
    word-break: break-all;
    max-width: 160px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
td a:hover {
    text-decoration: underline;
    color: #137e5e !important;
}
/* 折叠/展开相关样式 */
.cell-ellipsis {
    max-width: 260px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
    transition: all .2s;
}
.cell-ellipsis.expanded {
    max-width: 100%;
    white-space: pre-wrap;
    overflow: auto;
    text-overflow: initial;
    word-break: break-all;
    background: none;
    display: block;
}
.btn-cell-toggle {
    margin-left: 0.5em;
    font-size: 0.95em;
    cursor: pointer;
    color: #2fa36b;
    background: none;
    border: none;
    padding: 0 2px;
    outline: none;
}
.btn-cell-toggle:hover {
    color: #137e5e;
    text-decoration: underline;
}
.errMsg {
    font-family: monospace, serif;
    font-size: 1em;
    color: #d33;
    font-weight: bold;
    margin-left: 1em;
}
#backToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #78c2ad;
    color: white;
    border: none;
    border-radius: 10px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 128, 0, 0.15);
    transition: background 0.3s, transform 0.2s;
    z-index: 1000;
}
#backToTop:hover {
    background: #14a77d;
    transform: scale(1.08);
}
@media (max-width: 768px) {
    .col-12, .col-md-8, .col-md-10, .col-lg-6 {
        width: 100% !important;
        margin-bottom: 18px;
    }
    h2 {
        font-size: 1.4rem;
        padding: 10px;
    }
    .card {
        padding: 8px !important;
    }
}

/* 让底部表格更宽 */
.table-wrapper {
    width: 90vw;
    max-width: 1000px;
    margin: 0 auto;
    overflow-x: auto;
}
.table {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/*移动端适应*/
@media (max-width: 768px) {
    /* 最外层内容居中、左右留白、卡片不贴边 */
    body {
        background: #eafaf1;
    }
    .container,
    .container-fluid {
        width: 100vw !important;
        max-width: 100vw !important;
        padding: 0 !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }
    .row,
    .col-12,
    .col-md-8,
    .col-md-10,
    .col-lg-6 {
        width: 100% !important;
        max-width: 100vw !important;
        margin: 0 auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        display: block !important;
    }
    .card {
        width: 94vw !important;
        max-width: 600px !important;
        margin: 16px auto !important;
        border-radius: 15px !important;
        box-shadow: 0 2px 12px rgba(44,186,156,0.11);
        padding: 14px 8px !important;
        background: #fff !important;
        box-sizing: border-box !important;
    }
    .table-wrapper,
    .table {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 auto !important;
        padding: 0 !important;
        background: transparent !important;
    }
    /* 卡片式表格：每条数据为一个卡片 */
    .table,
    .table thead,
    .table tbody,
    .table th,
    .table td,
    .table tr {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .table thead {
        display: none !important;
    }
    .table tr {
        margin-bottom: 17px;
        background: #ffffff !important;
        border-radius: 14px;
        box-shadow: 0 2px 12px rgba(44,186,156,0.07);
        border: 1px solid #c2e2d0 !important;
        padding: 11px 10px 8px 10px;
    }
    .table td {
        border: none !important;
        padding: 6px 6px 6px 12px !important;
        font-size: 1.1em !important;
        background: none !important;
        text-align: left !important;
        word-break: break-all !important;
        box-sizing: border-box !important;
    }
    .table td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #14a77d;
        display: block;
        margin-bottom: 3px;
        font-size: 1.08em;
        letter-spacing: 0.02em;
    }
    .table caption {
        text-align: center !important;
        font-size: 1.10em !important;
        margin-bottom: 7px !important;
    }
    /* 搜索输入区、按钮等全部自适应并有边距 */
    .form-control,
    #inputSearch {
        width: 100% !important;
        min-width: 0 !important;
        font-size: 1.13em !important;
        height: 44px !important;
        margin-bottom: 8px !important;
        box-sizing: border-box !important;
    }
    .input-group {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
    }
    #btnSubmit {
        width: 100% !important;
        font-size: 1.11em !important;
        height: 44px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin: 0 !important;
        padding: 0 !important;
    }
    #btnSubmit i {
        margin-right: 7px !important;
    }
}


@media (max-width: 768px) {
    .table caption {
        display: table-caption !important; /* 彻底恢复正常表头流 */
        text-align: center !important;
        white-space: nowrap !important;
        word-break: keep-all !important;
        font-size: 1.07em !important;
        font-weight: bold;
        color: #24b090;
        padding: 5px 0 3px 0;
        margin: 0 auto !important;
        line-height: 1.7;
        width: 100% !important;
    }
}


/* 给每条新加载的表格行加“fade-in”动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px);}
    to   { opacity: 1; transform: translateY(0);}
}
tr.fade-in {
    animation: fadeIn 0.5s;
}
