* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #172033;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.query-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .55) 28%, transparent 29%),
        linear-gradient(116deg, rgba(204, 213, 219, .9) 0 18%, transparent 18% 76%, rgba(204, 213, 219, .78) 76% 100%),
        repeating-linear-gradient(0deg, rgba(30, 55, 70, .055) 0 1px, transparent 1px 5px),
        repeating-linear-gradient(90deg, rgba(30, 55, 70, .045) 0 1px, transparent 1px 5px),
        #edf2f4;
}

.query-page {
    min-height: 100vh;
    padding-bottom: 48px;
    overflow-x: hidden;
}

.verify-page {
    min-height: 100vh;
    padding-top: 24vh;
    background: #642d2d;
}

.verify-panel {
    width: 100%;
    padding: 28px 26px 20px;
    background: #dbe5ef;
}

.verify-panel h1 {
    margin: 0 0 86px;
    color: #fff;
    font-size: clamp(23px, 6vw, 30px);
    font-weight: 800;
    text-align: center;
}

.verify-form {
    width: min(560px, calc(100% - 20px));
    margin: 0 auto;
    display: grid;
    gap: 40px;
}

.verify-form label {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
}

.verify-form span {
    color: #fff;
    font-size: 18px;
    font-weight: 800;
}

.verify-form input {
    height: 32px;
    padding: 0 10px;
    color: #111827;
    background: #fff;
    border: 1px solid #3d70ff;
    border-radius: 8px;
    outline: none;
}

.verify-form input:focus {
    box-shadow: 0 0 0 3px rgba(61, 112, 255, .18);
}

.verify-form button {
    width: min(245px, 72%);
    height: 41px;
    justify-self: center;
    color: #fff;
    font-weight: 800;
    background: #6f6f6f;
    border: 2px solid #1f1f1f;
    border-radius: 5px;
    cursor: pointer;
}

.phone-top {
    display: grid;
    grid-template-columns: 56px 1fr 56px;
    align-items: center;
    padding: 18px 10px 14px;
    background: rgba(245, 246, 247, .92);
}

.close-mark,
.more-mark {
    color: #171b22;
    font-size: 42px;
    line-height: 1;
    text-align: center;
}

.more-mark {
    align-self: start;
    font-size: 34px;
    letter-spacing: 2px;
}

.query-title {
    text-align: center;
}

.query-title h1 {
    margin: 0;
    color: #171b22;
    font-size: clamp(24px, 6.8vw, 36px);
    font-weight: 800;
    letter-spacing: 1px;
}

.query-title p {
    margin: 5px 0 0;
    color: #757b86;
    font-size: clamp(17px, 5vw, 27px);
    font-weight: 700;
    letter-spacing: 1px;
}

.query-card {
    width: min(920px, 100%);
    margin: 34px auto 0;
    padding: 0 14px;
}

.query-row {
    display: grid;
    grid-template-columns: minmax(142px, 32%) 1fr;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
}

.query-label {
    color: #111827;
    font-size: clamp(18px, 3.9vw, 26px);
    line-height: 1.15;
    text-align: right;
    white-space: nowrap;
}

.query-value {
    min-height: 50px;
    display: flex;
    align-items: center;
    padding: 9px 22px;
    color: #173153;
    font-size: clamp(17px, 3.6vw, 23px);
    line-height: 1.35;
    word-break: break-all;
    background: rgba(229, 230, 231, .95);
    border: 1px solid rgba(183, 188, 192, .9);
    border-radius: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08), 0 1px 2px rgba(255, 255, 255, .72);
}

.query-row:first-child {
    grid-template-columns: minmax(156px, 31%) 1fr;
}

.query-row:nth-child(2) .query-value,
.query-row:nth-child(3) .query-value,
.query-row:nth-child(4) .query-value,
.query-row:nth-child(5) .query-value,
.query-row:nth-child(7) .query-value,
.query-row:nth-child(8) .query-value,
.query-row:nth-child(9) .query-value {
    width: min(100%, 366px);
}

.query-row:nth-child(1) .query-value,
.query-row:nth-child(6) .query-value {
    width: min(100%, 584px);
}

.empty-state {
    width: min(86vw, 560px);
    margin: 22vh auto 0;
    padding: 28px 22px;
    color: #374151;
    font-size: 22px;
    line-height: 1.7;
    text-align: center;
    background: rgba(255, 255, 255, .76);
    border: 1px solid rgba(196, 203, 210, .8);
    border-radius: 14px;
}

.admin-body {
    min-height: 100vh;
    background: #eef2f6;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 32px;
    color: #fff;
    background: #182235;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .18);
}

.admin-header strong {
    display: block;
    font-size: 20px;
}

.admin-header span {
    color: #aeb8c8;
    font-size: 13px;
}

.admin-header nav {
    display: flex;
    gap: 16px;
}

.admin-header a {
    color: #dbeafe;
    text-decoration: none;
}

.admin-main {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto 60px;
}

.login-card,
.form-card,
.table-card,
.toolbar {
    background: #fff;
    border: 1px solid #dbe3ec;
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, .08);
}

.login-card {
    width: min(440px, 100%);
    margin: 80px auto;
    padding: 32px;
}

.login-card h1,
.form-card h1 {
    margin: 0 0 10px;
}

.login-card p {
    margin: 0 0 22px;
    color: #64748b;
}

.form-hint {
    margin: 0 0 22px;
    color: #64748b;
}

.account-card {
    width: min(560px, 100%);
}

.admin-form {
    display: grid;
    gap: 18px;
}

.admin-form label {
    display: grid;
    gap: 8px;
}

.admin-form span {
    color: #334155;
    font-weight: 700;
}

.admin-form input,
.admin-form select,
.search-form input {
    width: 100%;
    height: 42px;
    padding: 0 13px;
    color: #111827;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
}

.admin-form input:focus,
.admin-form select:focus,
.search-form input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.admin-form em,
.form-error {
    color: #dc2626;
    font-style: normal;
}

.primary-btn,
.search-form button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    padding: 0 18px;
    color: #fff;
    text-decoration: none;
    background: #1d4ed8;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px;
    margin-bottom: 18px;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.search-form a {
    color: #475569;
    text-decoration: none;
}

.table-card {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 15px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    color: #475569;
    font-size: 14px;
    background: #f8fafc;
}

.empty-cell {
    padding: 40px;
    color: #64748b;
    text-align: center;
}

.status-pill {
    display: inline-flex;
    padding: 4px 10px;
    color: #0f766e;
    background: #ccfbf1;
    border-radius: 999px;
}

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

.actions a,
.link-btn {
    color: #1d4ed8;
    text-decoration: none;
    background: none;
    border: 0;
    cursor: pointer;
}

.actions form {
    margin: 0;
}

.actions button[type="submit"] {
    color: #dc2626;
    background: none;
    border: 0;
    cursor: pointer;
}

.qr-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.form-card {
    padding: 28px;
}

.grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    grid-column: 1 / -1;
}

.form-actions a {
    color: #475569;
    text-decoration: none;
}

.flash {
    margin-bottom: 18px;
    padding: 12px 16px;
    border-radius: 12px;
}

.flash.success {
    color: #166534;
    background: #dcfce7;
}

.flash.error {
    color: #991b1b;
    background: #fee2e2;
}

.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, .55);
}

.modal-card {
    position: relative;
    width: min(520px, 100%);
    padding: 26px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
}

.modal-card h2 {
    margin: 0 0 18px;
    font-size: 22px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    color: #475569;
    font-size: 28px;
    line-height: 1;
    background: #f1f5f9;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

.qr-preview {
    display: grid;
    justify-items: center;
    gap: 12px;
}

.qr-preview canvas {
    width: min(300px, 82vw);
    height: min(300px, 82vw);
    border: 1px solid #e2e8f0;
}

.qr-preview p {
    margin: 0;
    color: #334155;
    font-weight: 700;
}

.qr-preview a,
.modal-actions a {
    color: #1d4ed8;
    word-break: break-all;
}

.url-preview {
    display: grid;
    gap: 16px;
}

.url-preview input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Modern admin skin */
.admin-body {
    color: #111827;
    background:
        radial-gradient(circle at 9% -8%, rgba(59, 130, 246, .22), transparent 32%),
        radial-gradient(circle at 88% 4%, rgba(14, 165, 233, .20), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #eef4fb 42%, #f7f9fc 100%);
}

.admin-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(37, 99, 235, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, .05) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, .72), transparent 70%);
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 20;
    width: min(1220px, calc(100% - 32px));
    margin: 18px auto 0;
    padding: 14px 18px;
    color: #0f172a;
    background: rgba(255, 255, 255, .86);
    border: 1px solid rgba(203, 213, 225, .72);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .10);
    backdrop-filter: blur(18px);
}

.admin-header > div:first-child {
    position: relative;
    padding-left: 48px;
}

.admin-header > div:first-child::before {
    content: "防";
    position: absolute;
    left: 0;
    top: 50%;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .28);
    transform: translateY(-50%);
}

.admin-header strong {
    color: #0f172a;
    font-size: 18px;
    letter-spacing: .2px;
}

.admin-header span {
    color: #64748b;
    font-size: 12px;
}

.admin-header nav {
    gap: 8px;
    padding: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.admin-header a {
    padding: 9px 13px;
    color: #334155;
    border-radius: 10px;
    transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}

.admin-header a:hover {
    color: #1d4ed8;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.admin-main {
    width: min(1220px, calc(100% - 32px));
    margin: 28px auto 72px;
}

.login-card,
.form-card,
.table-card,
.toolbar {
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: 22px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .09);
}

.login-card {
    position: relative;
    padding: 38px;
    overflow: hidden;
    border-top: 4px solid #2563eb;
    animation: softEnter .48s ease both;
}

.login-card::before {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -88px;
    top: -88px;
    background: radial-gradient(circle, rgba(37, 99, 235, .18), transparent 68%);
    border-radius: 999px;
    animation: softGlow 4.8s ease-in-out infinite;
    pointer-events: none;
}

.login-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 0 38%, rgba(255, 255, 255, .42) 46%, transparent 54% 100%);
    transform: translateX(-120%);
    animation: cardSweep 5.6s ease-in-out infinite;
    pointer-events: none;
}

.login-card h1,
.form-card h1 {
    color: #0f172a;
    font-size: 24px;
    letter-spacing: -.4px;
}

.login-card h1,
.login-card .admin-form,
.login-card .form-error {
    position: relative;
    z-index: 1;
}

.login-card .primary-btn {
    position: relative;
    overflow: hidden;
}

.login-card .primary-btn::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -58%;
    width: 42%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .36), transparent);
    transform: skewX(-20deg);
    animation: buttonLight 3.4s ease-in-out infinite;
}

@keyframes softEnter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes softGlow {
    0%, 100% {
        opacity: .72;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.16);
    }
}

@keyframes cardSweep {
    0%, 62% {
        transform: translateX(-120%);
    }
    100% {
        transform: translateX(120%);
    }
}

@keyframes buttonLight {
    0%, 48% {
        left: -58%;
    }
    100% {
        left: 120%;
    }
}

.toolbar {
    padding: 18px;
    margin-bottom: 18px;
}

.search-form input,
.admin-form input,
.admin-form select,
.url-preview input {
    height: 46px;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #d8e1ec;
    border-radius: 12px;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.search-form input:hover,
.admin-form input:hover,
.admin-form select:hover {
    background: #fff;
    border-color: #bfd0e5;
}

.search-form input:focus,
.admin-form input:focus,
.admin-form select:focus,
.url-preview input:focus {
    background: #fff;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.primary-btn,
.search-form button {
    min-height: 46px;
    padding: 0 20px;
    font-weight: 700;
    white-space: nowrap;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .22);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.primary-btn:hover,
.search-form button:hover {
    filter: brightness(1.03);
    box-shadow: 0 16px 32px rgba(37, 99, 235, .28);
    transform: translateY(-1px);
}

.search-form a,
.form-actions a {
    color: #64748b;
    padding: 9px 11px;
    border-radius: 10px;
}

.search-form a:hover,
.form-actions a:hover {
    color: #1d4ed8;
    background: #eff6ff;
}

.table-card {
    border-radius: 22px;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

th {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .3px;
    background: #f8fafc;
}

thead th:first-child {
    border-top-left-radius: 22px;
}

thead th:last-child {
    border-top-right-radius: 22px;
}

.search-form button {
    min-width: 82px;
}

td {
    color: #1f2937;
    background: rgba(255, 255, 255, .76);
}

tbody tr {
    transition: transform .16s ease, box-shadow .16s ease;
}

tbody tr:hover td {
    background: #f8fbff;
}

.status-pill {
    padding: 5px 11px;
    color: #047857;
    font-size: 13px;
    font-weight: 800;
    background: #d1fae5;
    border: 1px solid #a7f3d0;
}

.actions a,
.link-btn {
    padding: 7px 9px;
    color: #2563eb;
    font-weight: 700;
    border-radius: 9px;
    transition: background .18s ease, color .18s ease;
}

.actions a:hover,
.link-btn:hover {
    color: #1e40af;
    background: #eff6ff;
}

.actions button[type="submit"] {
    padding: 7px 9px;
    color: #dc2626;
    font-weight: 700;
    border-radius: 9px;
}

.actions button[type="submit"]:hover {
    background: #fef2f2;
}

.form-card {
    padding: 32px;
}

.admin-form span {
    color: #334155;
    font-size: 14px;
}

.flash {
    border: 1px solid transparent;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
}

.flash.success {
    color: #047857;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.flash.error {
    color: #b91c1c;
    background: #fff1f2;
    border-color: #fecdd3;
}

.modal-card {
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 22px;
}

@media (max-width: 720px) {
    .admin-header,
    .toolbar,
    .search-form {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-header nav {
        flex-wrap: wrap;
    }

    .table-card {
        overflow: visible;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
    }

    thead {
        display: none;
    }

    tbody {
        display: grid;
        gap: 14px;
    }

    tbody tr {
        padding: 16px;
        background: rgba(255, 255, 255, .96);
        border: 1px solid rgba(226, 232, 240, .92);
        border-radius: 18px;
        box-shadow: 0 14px 36px rgba(15, 23, 42, .08);
    }

    tbody tr:hover td {
        background: transparent;
    }

    td {
        display: grid;
        grid-template-columns: 92px 1fr;
        align-items: start;
        gap: 12px;
        min-height: auto;
        padding: 10px 0;
        background: transparent;
        border-bottom: 1px solid #edf2f7;
        word-break: break-word;
    }

    td:last-child {
        border-bottom: 0;
    }

    td::before {
        color: #64748b;
        font-size: 13px;
        font-weight: 800;
        line-height: 1.8;
    }

    td:nth-child(1)::before {
        content: "防伪号码";
    }

    td:nth-child(2)::before {
        content: "被审验单位";
    }

    td:nth-child(3)::before {
        content: "报备状态";
    }

    td:nth-child(4)::before {
        content: "二维码";
    }

    td:nth-child(5)::before {
        content: "操作";
    }

    .qr-tools,
    .actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }

    .actions form {
        display: inline-flex;
    }

    .actions a,
    .link-btn,
    .actions button[type="submit"] {
        display: inline-flex;
        align-items: center;
        min-height: 32px;
        padding: 5px 9px;
        font-size: 14px;
        white-space: nowrap;
        background: #eff6ff;
    }

    .actions button[type="submit"] {
        background: #fef2f2;
    }

    .empty-cell {
        display: block;
        padding: 28px;
    }

    .empty-cell::before {
        display: none;
    }

    .grid-form {
        grid-template-columns: 1fr;
    }

    .query-row {
        grid-template-columns: 136px 1fr;
        gap: 12px;
        margin-bottom: 24px;
    }

    .query-row:first-child {
        grid-template-columns: 136px 1fr;
    }

    .query-label {
        font-size: 16px;
    }

    .query-value {
        min-height: 44px;
        padding: 8px 14px;
        font-size: 16px;
        overflow-wrap: anywhere;
    }

    .query-row:nth-child(2) .query-value,
    .query-row:nth-child(3) .query-value,
    .query-row:nth-child(4) .query-value,
    .query-row:nth-child(5) .query-value,
    .query-row:nth-child(7) .query-value,
    .query-row:nth-child(8) .query-value,
    .query-row:nth-child(9) .query-value {
        width: min(100%, 300px);
    }

    .query-row:nth-child(1) .query-value,
    .query-row:nth-child(6) .query-value {
        width: min(100%, 620px);
    }
}

@media (max-width: 420px) {
    .phone-top {
        grid-template-columns: 34px 1fr 34px;
        padding: 14px 8px 12px;
    }

    .query-title h1 {
        font-size: 25px;
    }

    .query-card {
        margin-top: 26px;
        padding: 0 8px 0 0;
    }

    .query-row,
    .query-row:first-child {
        grid-template-columns: 126px 1fr;
        gap: 10px;
        margin-bottom: 22px;
    }

    .query-label {
        font-size: 15px;
    }

    .query-value {
        min-height: 40px;
        padding: 7px 12px;
        font-size: 15px;
    }

    .query-row:nth-child(2) .query-value,
    .query-row:nth-child(3) .query-value,
    .query-row:nth-child(4) .query-value,
    .query-row:nth-child(5) .query-value,
    .query-row:nth-child(7) .query-value,
    .query-row:nth-child(8) .query-value,
    .query-row:nth-child(9) .query-value {
        width: min(100%, 235px);
    }

    .query-row:nth-child(1) .query-value,
    .query-row:nth-child(6) .query-value {
        width: min(100%, 100%);
    }
}

@media (max-width: 380px) {
    .query-card {
        margin-top: 22px;
        padding-right: 6px;
    }

    .query-row,
    .query-row:first-child {
        grid-template-columns: 116px 1fr;
        gap: 8px;
        margin-bottom: 19px;
    }

    .query-label {
        font-size: 14px;
    }

    .query-value {
        min-height: 38px;
        padding: 6px 10px;
        font-size: 14px;
    }

    .query-row:nth-child(2) .query-value,
    .query-row:nth-child(3) .query-value,
    .query-row:nth-child(4) .query-value,
    .query-row:nth-child(5) .query-value,
    .query-row:nth-child(7) .query-value,
    .query-row:nth-child(8) .query-value,
    .query-row:nth-child(9) .query-value {
        width: min(100%, 215px);
    }
}
