/* Query Page Styles - Split Layout */
:root {
    --primary-color: #0e2a6b;
    --primary-dark: #0a3580;
    --primary-title-color: #0e2a6b;
    --text-color: #333;
    --text-light: #666;
    --text-lighter: #999;
    --bg-light: #f9fbfd;
    --primary-light: #e6f7ff;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', "Microsoft YaHei", sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header - Logo Row */
.query-header {
    height: 70px;
    padding: 0 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 100;
}

.contact-block {
    display: flex;
    align-items: center;
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    line-height: normal;
    border: 1px solid transparent;
    /* Keep same box size as others with borders */
}

.contact-block:hover {
    background: var(--primary-light-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px var(--primary-shadow);
}

.nav-query-btn {
    display: flex;
    align-items: center;
    background: transparent;
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--primary-color);
    margin-right: 15px;
    line-height: normal;
}

.nav-query-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    fill: currentColor;
}

.nav-query-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px var(--primary-shadow);
}

.nav-query-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.contact-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    fill: currentColor;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-container img {
    height: 40px;
    width: auto;
    max-height: 48px;
    object-fit: contain;
}

/* 默认证书Logo样式（SVG图标 + 企业名称，颜色自适应主题） */
.brand-logo-default {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    line-height: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.brand-logo-default:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.brand-logo-svg {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 5px var(--primary-shadow, rgba(22, 119, 255, 0.15)));
}

.brand-logo-text {
    font-size: 19px;
    font-weight: 700;
    color: var(--primary-color, #1677ff);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 380px;
    line-height: 1.25;
}

.header-actions {
    display: flex;
    align-items: center;
}

.language-btn {
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-color: #ddd;
    color: #666;
    line-height: normal;
    display: flex;
    align-items: center;
}

.language-btn:hover,
.language-btn:focus {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.language-btn::after {
    margin-left: 8px;
}

/* Ensure no bullets show even if Bootstrap fails */
.header-actions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* On mobile */
@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
}

/* Bootstrap Dropdown Overrides */
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--primary-color) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--primary-light) !important;
    color: var(--primary-color) !important;
}

/* Main Content - Split Layout (For Index Page) */
.query-main {
    flex: 1;
    display: flex;
    height: calc(100vh - 70px - 40px);
}

/* Standard Page Content (For List/Details) */
.query-page-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px 20px;
    background-color: var(--bg-light);
    /* Premium Aura Background */
    background-image:
        radial-gradient(at 0% 0%, var(--aura-1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, var(--aura-2) 0px, transparent 50%),
        radial-gradient(at 100% 100%, var(--aura-1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, var(--aura-2) 0px, transparent 50%),
        radial-gradient(at 50% 50%, var(--aura-3) 0px, transparent 50%),
        linear-gradient(180deg, var(--primary-lighter) 0%, #ffffff 100%);
    background-attachment: fixed;
    background-size: cover;
}

/* List Page Styles */
.query-list-container {
    max-width: 1000px;
    margin: 0 auto;
}

.page-title {
    text-align: center;
    color: var(--primary-title-color);
    /* Darker blue from screenshot */
    font-size: 36px;
    /* Increased from 32px */
    font-weight: bold;
    margin-top: 100px;
    /* Increased from 80px */
    margin-bottom: 50px;
    /* Increased from 40px */
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
    width: 100%;
}

/* Decorative underline for title */
.page-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    margin: 15px auto 0;
    border-radius: 2px;
}

/* New Cert Card Style */
.cert-card {
    background: #fff;
    animation: fadeInUp 0.5s ease-out;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e8e8e8;
    padding: 0;
    /* Clear padding for internal flex */
}

.cert-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.cert-card-body {
    display: flex;
    justify-content: space-between;
    padding: 24px 24px 24px 60px;
    /* Left padding increased to avoid ribbon overlap */
}

/* Status Ribbon */
.cert-ribbon-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    overflow: hidden;
    z-index: 2;
}

.cert-ribbon {
    position: absolute;
    top: 10px;
    left: -30px;
    width: 100px;
    background-color: var(--primary-color);
    color: #fff;
    text-align: center;
    transform: rotate(-45deg);
    font-size: 12px;
    line-height: 24px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Left Content */
.cert-main-info {
    flex: 1;
    padding-right: 20px;
    display: flex;
    flex-direction: column;
}

.cert-card-title {
    font-size: 20px;
    color: var(--primary-title-color);
    font-weight: bold;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.cert-card-desc {
    font-size: 14px;
    color: #666;
    margin: 0 0 16px 0;
    line-height: 1.6;
}

/* Certificate No Tag */
.cert-no-tag {
    display: inline-block;
    background-color: #f0f5ff;
    /* Fallback light blue */
    background-color: var(--primary-light, #f0f5ff);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-family: Consolas, Monaco, monospace;
    /* Consistent numbering font */
    align-self: flex-start;
}

/* Right Content */
.cert-side-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    min-width: 80px;
}

.e-cert-icon {
    width: 48px;
    height: 48px;
    background-color: var(--primary-title-color);
    /* Deep color */
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.25;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cert-card-date {
    font-size: 14px;
    color: #999;
    margin-top: auto;
    /* Push to bottom if height grows */
    padding-top: 10px;
}




/* Left components: Form Section */
.form-section {
    flex: 3;
    background: var(--bg-light);
    background-image:
        radial-gradient(at 0% 0%, var(--aura-1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, var(--aura-2) 0px, transparent 50%),
        linear-gradient(135deg, var(--gradient-1) 0%, var(--gradient-2) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 5%;
    position: relative;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.05);
    z-index: 5;
}

.form-title {
    font-size: 32px;
    color: var(--primary-title-color);
    margin-bottom: 40px;
    font-weight: bold;
}

/* Right components: Cover Image */
.cover-section {
    flex: 7;
    background-image: url('../images/login-bg.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
}

.cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #000;
    opacity: .5;
}

/* Footer */
.query-footer {
    min-height: 40px;
    padding: 10px 15px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 12px;
    color: #999;
    border-top: 1px solid #eee;
}

.query-footer p {
    margin: 0;
    text-align: center;
    width: 100%;
}

/* Tabs */
.query-tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 2px solid #e1e1e1;
}

.query-tab-btn {
    padding: 10px 0;
    margin-right: 25px;
    background: none;
    border: none;
    font-size: 16px;
    color: #888;
    cursor: pointer;
    position: relative;
    font-weight: 500;
}

.query-tab-btn.active {
    color: var(--primary-color);
    font-weight: bold;
}

.query-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

/* Form Styling */
.form-group {
    margin-bottom: 20px;
}

.form-control-custom {
    width: 100%;
    height: 45px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-glow);
    outline: none;
}

.btn-query {
    width: 100%;
    height: 45px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 15px;
}

.btn-query:hover {
    background: var(--primary-dark);
}

.query-notes {
    margin-top: 25px;
    font-size: 12px;
    color: #888;
    line-height: 1.6;
}


/* Default: Hide menu toggle on desktop */
.mobile-menu-toggle {
    display: none;
}

/* Query List Container */
.query-list-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Details Page Styles */
.query-details-container {
    max-width: 1000px;
    margin: 0 auto 50px auto;
    /* Added bottom margin */
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: #666;
    text-decoration: none;
    font-size: 15px;
    margin-bottom: 20px;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--primary-color);
}

.details-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 40px var(--primary-shadow);
    margin-bottom: 25px;
    animation: fadeInUp 0.6s ease-out;
}

.details-title {
    font-size: 28px;
    color: var(--primary-title-color);
    font-weight: bold;
    margin: 0 0 15px 0;
}

.details-meta {
    font-size: 13px;
    color: #999;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.cert-image-wrapper {
    width: 100%;
    /* Mix with white to make it 60% lighter */
    background: color-mix(in srgb, var(--primary-light), white 60%);
    /* Themed background */
    border: 1px solid color-mix(in srgb, var(--primary-light), white 60%);
    /* Lighter border per user request */
    padding: 30px;
    text-align: center;
    border-radius: 4px;
}

.cert-image-wrapper img {
    max-width: 100%;
    height: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.download-bar {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    animation: fadeInUp 0.5s ease-out 0.2s backwards;
}

.btn-download {
    background: var(--primary-color);
    /* Darker blue per screenshot */
    color: #fff;
    border: none;
    padding: 12px 40px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
    /* Ensure no underline */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-download:hover {
    background: var(--primary-dark);
}

.btn-download-img {
    background: #fff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 12px 40px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-download-img:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.btn-print {
    background: #fff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 12px 40px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-print:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .query-header {
        padding: 0 15px;
        height: 60px;
        /* Fixed height for header */
        flex-direction: row;
        /* Keep row for logo and toggle */
        gap: 0;
        position: relative;
    }

    .logo-container img {
        height: 30px;
    }

    .brand-logo-svg {
        width: 30px;
        height: 30px;
    }

    .brand-logo-text {
        font-size: 16px;
        max-width: 200px;
    }

    /* Mobile Menu Toggle - SHOW on mobile */
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: 1px solid #eee;
        border-radius: 4px;
        padding: 5px;
        cursor: pointer;
        color: #333;
    }

    /* Hide default contact block and style wrapper as drawer */
    .contact-block-wrapper {
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: white;
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        z-index: -1;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .contact-block-wrapper.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .contact-block {
        width: 100%;
        justify-content: center;
        background: #f8f9fa;
        padding: 15px;
    }

    .nav-query-btn {
        width: 100%;
        justify-content: center;
        margin-right: 0;
        margin-bottom: 15px;
        padding: 15px;
    }


    .query-main {
        flex-direction: column;
        overflow-y: visible;
        height: auto;
        min-height: 0;
        flex: 1;
    }

    .query-page-content {
        padding: 15px;
    }

    .query-list-container {
        width: 100%;
    }

    .page-title {
        font-size: 24px;
        margin-top: 60px;
        /* Increased from 20px */
        margin-bottom: 30px;
    }

    .cert-card {
        margin-bottom: 25px;
        position: relative;
    }

    .cert-card-body {
        padding: 38px 20px 20px 60px;
        /* Top padding increased to separate date and title */
        flex-direction: column;
    }

    .cert-card-title {
        font-family: 'Microsoft YaHei', sans-serif;
        font-size: 14px;
        /* Reduced to 14px */
        letter-spacing: 0.5px;
        /* Wider spacing */
        margin-bottom: 8px;
    }

    .cert-card-desc {
        font-size: 13px;
        margin-bottom: 12px;
        padding-left: 0 !important;
    }

    .cert-no-tag {
        font-size: 13px;
        padding: 4px 10px;
    }

    .cert-side-info {
        display: block;
        min-width: auto;
    }

    .e-cert-icon {
        display: none;
        /* Hide icon on mobile per user request */
    }

    /* Position Date at Top Right on mobile */
    .cert-card-date {
        position: absolute;
        top: 12px;
        /* Centered in the top padding area */
        right: 15px;
        font-size: 12px;
        /* Restored size slightly or keep 11? 12px fits headers better */
        color: #999;
        margin: 0;
        padding: 0;
        white-space: nowrap;
    }

    .form-section {
        flex: 1;
        width: 100%;
        order: 2;
        padding: 30px 20px 60px 20px;
    }

    .cover-section {
        height: 200px;
        flex: none;
        order: 1;
    }

    /* Mobile Details Page Styles */
    .query-details-container {
        padding: 0;
    }

    .details-card {
        padding: 20px;
        margin-bottom: 20px;
    }

    .details-title {
        font-size: 20px;
        line-height: 1.4;
    }

    .details-meta {
        font-size: 12px;
        margin-bottom: 20px;
    }

    .btn-download,
    .btn-download-img {
        width: 100%;
        padding: 12px 0;
    }

    .btn-print {
        display: none;
        /* Hide print button on mobile */
    }

    .download-bar {
        padding: 15px;
    }
}

.cert-details-card-section {
    margin-top: 30px;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    /* Added padding */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    /* Added shadow to match other cards */
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.header-line {
    width: 4px;
    height: 18px;
    background-color: var(--primary-color);
    margin-right: 10px;
    border-radius: 2px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.info-table-grid {
    display: flex;
    flex-wrap: wrap;
    border-top: 1px solid #eee;
    border-left: 1px solid #eee;
}

.info-group {
    width: 50%;
    /* 2 items per row on desktop */
    display: flex;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #eee;
    box-sizing: border-box;
    /* Important for borders */
}

.info-label {
    width: 120px;
    background-color: #f9f9f9;
    padding: 12px 15px;
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.info-value {
    flex: 1;
    padding: 12px 15px;
    color: #333;
    font-size: 14px;
    word-break: break-all;
    display: flex;
    align-items: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .info-group {
        width: 100%;
        /* 1 item per row on mobile */
    }

    .info-label {
        width: 100px;
        /* Smaller label width on mobile */
        padding: 10px;
        font-size: 13px;
    }

    .info-value {
        padding: 10px;
        font-size: 13px;
    }
}

/* Loading Spinner */
.loading-spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    width: 100%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.cert-image {
    display: none;
    max-width: 100%;
    height: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}