/* ========== 基础重置 ========== */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: #f2f6f4;
    color: #1f2d3d;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

[v-cloak] {
    display: none;
}

h1,
h2,
h3,
p {
    margin: 0;
}

button {
    font-family: inherit;
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 2px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: #c3d4ca;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9fb8a9;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* ========== 顶部 ========== */
.site-header {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, #008842 0%, #099f52 58%, #14b767 100%);
    color: #fff;
}

.site-header::after {
    content: "";
    position: absolute;
    right: -90px;
    top: -140px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
}

.site-header::before {
    content: "";
    position: absolute;
    right: 180px;
    bottom: -160px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .05);
}

.header-inner {
    position: relative;
    z-index: 2;
    max-width: 1900px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-logo {
    flex: none;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .32);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

.brand-logo img {
    width: 100%;
    height: 100%;
}

.brand-text {
    min-width: 0;
}

.brand-text h1 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-text p {
    margin-top: 3px;
    font-size: 12px;
    letter-spacing: 0.4px;
    opacity: .82;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-badge {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: .5px;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .28);
}

.header-badge i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a9f5cb;
    box-shadow: 0 0 0 3px rgba(169, 245, 203, .28);
}

/* ========== 主体 ========== */
.main {
    max-width: 1900px;
    margin: 0 auto;
    padding: 24px 20px 64px;
}

.panel {
    background: #fff;
    border: 1px solid #e8efeb;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 80, 45, .06);
    overflow: hidden;
}

.panel+.panel {
    margin-top: 20px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 15px 20px;
    border-bottom: 1px solid #eef3f0;
    background: linear-gradient(180deg, #f8fbf9, #fff);
}

.panel-head h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #17232e;
}

.panel-head h2 i {
    font-size: 14px;
    font-weight: normal;
    font-style: normal;
    color: #8b98a3;
}

.panel-head h2 .bar {
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(180deg, #099f52, #008842);
}

.panel-tip {
    font-size: 12px;
    color: #93a1ac;
}

/* ========== 查询表单 ========== */
.search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 200px) auto;
    gap: 16px 20px;
    align-items: end;
    padding: 22px 20px 24px;
}

.form-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.form-item label {
    font-size: 14px;
    color: #5c6b7a;
    font-weight: 500;
}

.form-item input,
.form-item select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    font-size: 16px;
    color: #1f2d3d;
    background: #fff;
    border: 1px solid #dbe4de;
    border-radius: 6px;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}

.form-item input::placeholder {
    color: #a8b4bd;
}

.form-item input:hover,
.form-item select:hover {
    border-color: #b9cdc2;
}

.form-item input:focus,
.form-item select:focus {
    outline: none;
    border-color: #099f52;
    box-shadow: 0 0 0 3px rgba(9, 159, 82, .13);
}

.form-item select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 34px;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.2l4 4 4-4' stroke='%235c6b7a' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.form-actions {
    display: flex;
    gap: 12px;
}

.btn {
    height: 42px;
    padding: 0 26px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    letter-spacing: 4px;
    transition: all .2s;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #099f52, #008842);
    box-shadow: 0 2px 8px rgba(9, 159, 82, .26);
    min-width: 200px;
    font-weight: 600;
}

.btn-primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 4px 14px rgba(9, 159, 82, .36);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-ghost {
    color: #3d4b57;
    background: #fff;
    border-color: #d5dfd9;
}

.btn-ghost:hover {
    color: #008842;
    border-color: #099f52;
    background: #f4fbf7;
}

.btn-ghost:active {
    transform: translateY(1px);
}

/* ========== 结果列表 ========== */
.result-count {
    font-size: 13px;
    color: #6b7a86;
}

.result-count b {
    color: #099f52;
    font-size: 15px;
    margin: 0 2px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid #eef3f0;
}

.page-count {
    margin-right: auto;
    color: #5c6b7a;
    font-size: 13px;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-button {
    width: 38px;
    height: 38px;
    flex: none;
    border: 1px solid #cbd5d0;
    border-radius: 6px;
    background: #fff;
    color: #1f2d3d;
    cursor: pointer;
}

.page-button:hover:not(:disabled),
.page-button:focus-visible {
    border-color: #099f52;
    color: #008842;
}

.page-button:disabled {
    color: #a8b4bd;
    cursor: not-allowed;
}

.cert-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #eef3f0;
    cursor: pointer;
    transition: background .2s;
}

.cert-card:last-child {
    border-bottom: none;
}

.cert-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: background .2s;
}

.cert-card:hover {
    background: #f6fbf8;
}

.cert-card:hover::before {
    background: #099f52;
}

.cert-card:focus-visible {
    outline: 2px solid #099f52;
    outline-offset: -2px;
}

.cert-main {
    flex: 1;
    min-width: 0;
}

.cert-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.cert-name {
    font-size: 18px;
    font-weight: 600;
    color: #17232e;
    transition: color .2s;
    word-break: break-all;
}

.cert-card:hover .cert-name {
    color: #008842;
}

.cert-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 6px 20px;
    margin-bottom: 10px;
}

.meta-item {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: #455461;
    min-width: 0;
    align-items: center;
}

.meta-item em {
    flex: none;
    font-style: normal;
    color: #8b98a3;
}

.meta-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cert-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tag {
    font-size: 12px;
    line-height: 18px;
    padding: 1px 8px;
    color: #008842;
    background: #eaf7f0;
    border: 1px solid #cbe9d9;
    border-radius: 4px;
    font-weight: 600;
}

.cert-arrow {
    flex: none;
    color: #c2cfc8;
    transition: color .2s, transform .2s;
}

.cert-card:hover .cert-arrow {
    color: #099f52;
    transform: translateX(3px);
}

/* 状态徽标 */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px;
    border-radius: 4px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    margin: 0 10px;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge.valid {
    color: #099f52;
    background: #e6f6ed;
}

.badge.paused {
    color: #c07800;
    background: #fdf4e4;
}

.badge.revoked {
    color: #d9382c;
    background: #fdecea;
}

.badge.expired {
    color: #77868f;
    background: #eef1f3;
}

/* 空状态 */
.empty {
    padding: 64px 20px;
    text-align: center;
    color: #8b98a3;
}

.empty i {
    opacity: .45;
    margin-bottom: 14px;
    font-size: 50px;
}

.empty p {
    font-size: 16px;
}

.empty p.sub {
    margin-top: 6px;
    font-size: 12.5px;
    color: #a8b4bd;
}

/* ========== 全屏详情弹窗 ========== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(12, 30, 22, .48);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
}

.modal-body {
    width: 100%;
    min-height: max-content;
    display: flex;
    flex-direction: column;
    background: #f2f6f4;
}

.modal-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 24px;
    color: #fff;
    background: linear-gradient(90deg, #008842, #099f52);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .14);
}

.modal-title h2 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: .5px;
}

.modal-title p {
    margin-top: 3px;
    font-size: 12px;
    letter-spacing: .5px;
    opacity: .82;
    word-break: break-all;
}

.modal-close {
    flex: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s, transform .25s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, .3);
    transform: rotate(90deg);
}

.modal-close i {
    font-size: 18px;
}

.modal-content {
    flex: 1;
    width: 100%;
    max-width: 1900px;
    margin: 0 auto;
    padding: 20px 20px 48px;
}

.detail-section {
    background: #fff;
    border: 1px solid #e8efeb;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 80, 45, .05);
    overflow: hidden;
}

.detail-section+.detail-section {
    margin-top: 18px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 15px 35px;
    font-size: 16px;
    font-weight: 600;
    color: #17232e;
    border-bottom: 1px solid #eef3f0;
    background: linear-gradient(180deg, #f8fbf9, #fff);
    position: relative;
}

.section-title::before {
    content: "";
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(180deg, #099f52, #008842);
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    margin: auto;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #eef3f0;
}

.info-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 20px;
    background: #fff;
    min-width: 0;
}

.info-item.full {
    grid-column: 1 / -1;
}

.info-item .label {
    flex: none;
    width: 98px;
    font-size: 13px;
    line-height: 21px;
    color: #7b8894;
}

.info-item .value {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    line-height: 21px;
    color: #1f2d3d;
    word-break: break-word;
}

.info-item .value.mono {
   /*  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;*/
    letter-spacing: .3px;
}

.value-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ========== 产品信息表格 ========== */
.product-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.product-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 16px;
}

.product-table thead th {
    padding: 11px 20px;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    color: #455461;
    letter-spacing: .3px;
    background: #f6fbf8;
    border-bottom: 1px solid #e8efeb;
    white-space: nowrap;
}

.product-table tbody td {
    padding: 13px 20px;
    color: #1f2d3d;
    line-height: 21px;
    vertical-align: top;
    background: #fff;
    border-bottom: 1px solid #eef3f0;
    word-break: break-word;
}

.product-table tbody tr:last-child td {
    border-bottom: none;
}

.product-table tbody tr:hover td {
    background: #f9fcfb;
}

.product-table .col-idx {
    width: 68px;
    text-align: center;
    color: #8b98a3;
}

.product-table td.col-idx {
    color: #8b98a3;
    font-variant-numeric: tabular-nums;
}

.product-table .col-name {
    width: 20%;
}

.product-table .col-cate {
    width: 15%;
}

.product-table .col-site {
    width: 25%;
}

.product-table .col-addr {
    width: 32%;
    color: #455461;
}

/* 单元格内的动态小标签（基地名称 / 生产场所） */
.cell-flag {
    display: inline-block;
    margin-right: 6px;
    padding: 0 6px;
    font-size: 11.5px;
    line-height: 18px;
    color: #008842;
    background: #eaf7f0;
    border: 1px solid #cbe9d9;
    border-radius: 3px;
    white-space: nowrap;
    vertical-align: 1px;
}

/* ========== 验证码弹窗 ========== */
.captcha-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(12, 30, 22, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.captcha-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
    width: 100%;
    max-width: 460px;
    padding: 22px;
    animation: captchaPop .22s ease;
}

@keyframes captchaPop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.captcha-title {
    font-size: 18px;
    font-weight: 600;
    color: #17232e;
    margin-bottom: 14px;
    text-align: center;
}

.captcha-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 18px;
    background: #f0f5ff;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 600;
    color: #099f52;
}

.captcha-header span {
    flex: 1;
    min-width: 0;
    word-break: break-all;
    line-height: 1.4;
    letter-spacing: .5px;
}

.refresh-btn {
    flex: none;
    border: none;
    background: transparent;
    font-size: 22px;
    color: #099f52;
    cursor: pointer;
    padding: 0 6px;
    transition: transform .3s;
}

.refresh-btn:hover:not(:disabled) {
    transform: rotate(180deg);
}

.refresh-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.captcha-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: crosshair;
    user-select: none;
    background: #f5f7fa;
    touch-action: manipulation;
}

.captcha-status {
    margin-top: 14px;
    font-size: 15px;
    text-align: center;
    min-height: 22px;
    color: #999;
}

.captcha-status.success {
    color: #52c41a;
    font-weight: 600;
}

.captcha-status.error {
    color: #ff4d4f;
    font-weight: 600;
}

.captcha-footer {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.captcha-footer .btn {
    height: 40px;
    padding: 0 32px;
    font-size: 15px;
    letter-spacing: 1px;
    min-width: 0;
}

/* 弹窗过渡 */
.fade-enter-active,
.fade-leave-active {
    transition: opacity .22s ease;
}

.fade-enter,
.fade-leave-to {
    opacity: 0;
}

/* ========== 响应式 ========== */
@media (max-width: 992px) {
    .search-form {
        grid-template-columns: 1fr 1fr;
    }

    .form-actions {
        grid-column: 1 / -1;
    }

    .form-actions .btn {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .form-item select {
        max-width: 100% !important;
    }

    .header-badge {
        display: none;
    }

    .brand-text h1 {
        font-size: 20px;
        letter-spacing: .5px;
    }

    .brand-text p {
        font-size: 11px;
    }

    .brand-logo {
        width: 60px;
        height: 60px;
        border-radius: 50%;
    }

    .main {
        padding: 18px 14px 56px;
    }

    .panel-head {
        padding: 13px 16px;
    }

    .search-form {
        padding: 18px 16px 20px;
    }

    .cert-card {
        padding: 16px;
        gap: 10px;
    }

    .cert-meta {
        grid-template-columns: 1fr;
    }

    .modal-header {
        padding: 13px 16px;
    }

    .modal-content {
        padding: 14px 12px 40px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-item {
        padding: 12px 16px;
    }

    .info-item .label {
        width: 88px;
        font-size: 12.5px;
    }

    /* 移动端：产品表格转为卡片式堆叠 */
    .product-table-wrap {
        overflow-x: visible;
    }

    .product-table {
        min-width: 0;
        table-layout: auto;
    }

    .product-table thead {
        display: none;
    }

    .product-table,
    .product-table tbody,
    .product-table tr,
    .product-table td {
        display: block;
        width: 100%;
    }

    .product-table tbody tr {
        padding: 8px 0;
        border-bottom: 1px solid #eef3f0;
    }

    .product-table tbody tr:last-child {
        border-bottom: none;
    }

    .product-table tbody td {
        display: flex;
        gap: 10px;
        padding: 5px 16px;
        border-bottom: none;
        background: transparent;
        width: 100% !important;
    }

    .product-table tbody tr:hover td {
        background: transparent;
    }

    .product-table tbody td::before {
        content: attr(data-label);
        flex: none;
        width: 96px;
        font-size: 12.5px;
        line-height: 21px;
        color: #7b8894;
    }

    .product-table .col-idx {
        width: 100%;
        text-align: left;
    }
}

@media (max-width: 560px) {
    .search-form {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: row;
    }

    .brand-text h1 {
        font-size: 19px;
    }

    .brand-text p {
        display: none;
    }

    .panel-head h2 {
        font-size: 15px;
    }

    .cert-name {
        font-size: 15px;
    }

    .captcha-panel {
        padding: 18px;
        max-width: 100%;
    }

    .captcha-header {
        font-size: 16px;
    }

    .captcha-title {
        font-size: 17px;
    }
}
