/* 确保mobile-only和desktop-only类在最高优先级的位置定义 */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: block !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(to bottom right, #DBEAFE, #BFDBFE, #f3e8ff);
    display: block;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 240px;
    background-color: white;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transition: transform 0.3s ease;
}

/* 左侧菜单按钮样式 */
.left-menu-toggle {
    display: none;
    position: fixed;
    left: 15px;
    bottom: 15px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #3B82F6;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0;
}

.left-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: white;
    margin: 3px 0;
    transition: all 0.3s ease;
}

/* 左侧菜单按钮动画 */
.left-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.left-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.left-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* 增强侧边栏内菜单项的样式 */
.sidebar .nav ul li a.active {
    background-color: #f0f7ff;
    border-left: 3px solid #3B82F6;
    font-weight: 500;
}

.sidebar .logo {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar .logo img {
    /*max-width: 30px;*/
    height: auto;
}

.main-content {
    margin-left: -120px;
    margin-top: 100px;
    padding: 2rem;
    min-height: calc(100vh - 60px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    z-index: 101;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

/* 认证成功状态下的卡片样式 */
#verifyStatusPage .card {
    max-width: 640px;
    padding: 1rem 2rem 2rem 2rem;
    text-align: center;
}

#verifyStatusPage .card-header {
    margin: -1rem -2rem 1rem -2rem;
}

.card-header {
    background: linear-gradient(to right, #3B82F6,
            #a855f7);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.card-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.card-description {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #e0f2fe;
}

.card-content {
    padding: 1rem;
}

.tabs {
    display: flex;
    margin-bottom: 1.5rem;
    font-size: 14px;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    background-color: white;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.tab.active {
    background-color: #dbeafe;
    color: #1D4ED8;
}

.tab.active:hover {
    background-color: #bfdbfe;
}

.tab:hover:not(.active) {
    background-color: #f4f4f5;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

input[type="text"] {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1.5rem;
    color: #374151;
    transition: all 0.2s;
}

input[type="text"]::placeholder {
    color: #9ca3af;
}

input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.file-upload {
    position: relative;
    border: 2px dashed #A5B4FC;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    background-color: #eff6ff;
    transition: all 0.2s;
    overflow: hidden;
}

.file-upload:hover {
    background-color: #8c96a9;
}

.file-upload-icon {
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.5rem;
    color: #3b82f6;
}

.file-upload p {
    margin: 0.25rem 0;
    color: #3b82f6;
}

.file-upload p:first-of-type {
    font-size: 0.875rem;
    font-weight: 600;
}

.file-upload p:last-of-type {
    font-size: 0.75rem;
}

.error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.button {
    background: linear-gradient(to right, #3B82F6,
            #a855f7);
    color: white;
    border: none;
    padding: 0.625rem 1rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.button:hover {
    opacity: 0.9;
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button-secondary {
    background: #e5e7eb;
    color: #374151;
}

.button-secondary:hover {
    background: #d1d5db;
}

.card-footer {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

.footer-text {
    font-size: 0.875rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin: 0;
}

.alert {
    background-color: #FEE2E2;
    border: 1px solid #EF4444;
    color: #DC2626;
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: none;
}

.tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #374151;
    color: white;
    text-align: center;
    border-radius: 0.375rem;
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
    font-weight: normal;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.step {
    display: none;
}

.step.active {
    display: block;
}

.step-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    gap: 0.75rem;
}

.next-button-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.loading {
    animation: rotate 1s linear infinite;
}

.icon {
    width: 1.25em;
    height: 1.25em;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

#nextButton {
    margin-left: auto;
}

#prevButton,
#submitButton {
    /* 保持原有样式 */
}

/* 添加可访问性样式 */
.button:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* 文件上传状态样式 */
.file-upload[aria-busy="true"] {
    opacity: 0.7;
    cursor: wait;
}

/* 上传进度条样式 */
.upload-progress {
    height: 4px;
    background: #3B82F6;
    border-radius: 2px;
    transition: width 0.3s ease;
    margin-top: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {

    /* 重要：确保所有菜单项在移动视图下始终显示 */
    .sidebar .nav ul li {
        display: block !important;
        visibility: visible !important;
    }

    .sidebar .nav ul li a {
        display: flex !important;
        visibility: visible !important;
    }

    body {
        padding-bottom: 60px;
        /* 为底部菜单留出空间 */
    }

    .mobile-only {
        display: flex !important;
    }

    .desktop-only {
        display: none !important;
    }

    /* 特别确保左下角菜单按钮显示 */
    #leftMenuToggle.mobile-only {
        display: flex !important;
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem 1rem;
        margin-top: 80px;
    }

    .card {
        max-width: 100%;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 250px;
        top: 0;
        height: 100vh;
        z-index: 9999;
        padding-top: 15px;
        overflow-y: auto;
        transition: transform 0.3s ease;
        background-color: white;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
        display: block !important;
    }

    /* 移动端下调整侧边栏内的导航菜单样式 */
    .sidebar .nav ul {
        display: flex;
        flex-direction: column;
        padding: 0;
        margin: 0;
        list-style: none;
        width: 100%;
    }

    .sidebar .nav ul li {
        margin: 0;
        width: 100%;
        display: block;
    }

    .sidebar .nav ul li a {
        padding: 15px 20px;
        display: flex;
        align-items: center;
        color: #333;
        text-decoration: none;
        font-size: 15px;
        transition: background-color 0.2s;
        border-left: 3px solid transparent;
        width: 100%;
        box-sizing: border-box;
    }

    .sidebar .nav ul li a img {
        width: 22px;
        height: 22px;
        margin-right: 15px;
    }

    .sidebar .nav ul li a:hover {
        background-color: #f8fafc;
    }

    .sidebar .nav ul li a.active {
        background-color: #f0f7ff;
        border-left: 3px solid #3B82F6;
        color: #3B82F6;
        font-weight: 500;
    }

    .left-menu-toggle {
        display: flex;
    }

    .header {
        height: 60px;
    }

    /* 实名认证页面特殊样式 */
    .verify-page .sidebar {
        display: block;
        z-index: 1010;
    }

    /* 确保左侧菜单可以滚动 */
    .sidebar .nav {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    /* 调整表单元素在移动设备上的显示 */
    .form-group {
        margin-bottom: 1.2rem;
    }

    input[type="text"] {
        font-size: 16px;
        /* 避免iOS上的缩放 */
        padding: 10px;
    }

    .tabs {
        font-size: 14px;
    }

    .tab {
        padding: 10px 5px;
    }

    .file-upload {
        padding: 1rem;
    }

    .file-upload p {
        font-size: 13px;
    }

    .step-buttons {
        flex-direction: row;
        gap: 10px;
    }

    .button {
        min-width: 100px;
        padding: 10px 15px;
        font-size: 14px;
    }

    /* 确保模态框在移动设备上有适当的宽度 */
    #imagePreviewModal .modal-content {
        width: 90%;
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .card-content {
        padding: 1rem 0.75rem;
    }

    .file-upload {
        padding: 1rem 0.5rem;
    }

    .step-buttons {
        justify-content: space-between;
    }

    .button {
        min-width: unset;
        flex: 0.48;
        font-size: 14px;
        padding: 10px;
    }

    /* 认证状态卡片适配小屏幕 */
    .status-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    /* 图片上传组件适配 */
    .file-upload p:first-of-type {
        font-size: 0.8rem;
    }

    .file-upload p:last-of-type {
        font-size: 0.7rem;
    }

    /* 调整图标大小 */
    .file-upload-icon {
        width: 1.5rem;
        height: 1.5rem;
    }
}

/* 添加成功状态样式 */
.success {
    color: #059669;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* 状态卡片样式 */
.status-card {
    display: none;
}

.status-section {
    text-align: center;
    padding: 10px 0;
}

.status-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.status-icon.pending {
    color: #F59E0B;
}

.status-icon.success {
    color: #10B981;
}

.status-icon.failed {
    color: #EF4444;
}

.status-info {
    background: #F3F4F6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 2rem;
}

.status-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: #374151;
}

.status-info-label {
    color: #6B7280;
}

.status-icon .icon {
    width: 100%;
    height: 100%;
}

/* 图片预览样式 */
.image-preview {
    margin-top: 1rem;
    max-width: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
}

/* 上传进度条样式优化 */
.upload-progress {
    height: 4px;
    background: linear-gradient(to right, #3B82F6, #8B5CF6);
    border-radius: 2px;
    transition: width 0.3s ease;
    margin-top: 0.5rem;
    animation: shimmer 1s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* 可访问性增强 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .button {
        border: 2px solid currentColor;
    }

    .error {
        background: #ffebee;
        border: 1px solid currentColor;
        padding: 0.5rem;
    }
}

/* 预览按钮样式 */
.preview-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin-top: 0.5rem;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.preview-button:hover {
    background-color: #e5e7eb;
}

.preview-button .icon {
    width: 1.25em;
    height: 1.25em;
}

/* 错误提示模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 15% auto;
    padding: 0;
    border-radius: 8px;
    width: 400px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: modalFadeIn 0.3s ease-out;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #1f2937;
}

.modal-body {
    padding: 20px;
    color: #4b5563;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
    text-align: right;
}

.modal-footer .button {
    min-width: 80px;
    margin-left: auto;
    display: inline-flex;
    justify-content: center;
}

.close {
    color: #9ca3af;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #4b5563;
}

/* 图片预览模态框样式 */
#imagePreviewModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

#imagePreviewModal .modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    max-width: 90%;
    max-height: 90vh;
    top: 50%;
    transform: translateY(-50%);
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#imagePreviewModal .modal-content img {
    max-width: 100%;
    max-height: calc(90vh - 40px);
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

#imagePreviewModal .close-button {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 24px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f3f4f6;
}

#imagePreviewModal .close-button:hover {
    background-color: #e5e7eb;
    color: #000;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 用户信息框样式 */
.user-info-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    text-align: left;
}

.info-item {
    margin: 8px 0;
    color: #1f2937;
    font-size: 14px;
}

.info-item .label {
    color: #6b7280;
    margin-right: 8px;
}

.verify-success-info {
    padding: 0;
    text-align: center;
    margin: 10px auto 0;
    width: 90%;
}

.id-card-style {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
    margin: 10px auto 20px;
    width: 300px;
}

.id-card-content {
    padding: 20px;
    position: relative;
}

.id-card-content .info-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 8px 0;
    padding: 4px 0;
}

.id-card-content .info-row:last-child {
    margin-bottom: 0;
}

.id-card-content .info-label {
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
    text-align: left;
}

.id-card-content .info-value {
    color: #1f2937;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: 1px;
}

.id-card-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #FFF;
    border-radius: 50%;
    padding: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.verify-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* 调整成功状态下的标题和描述文字间距 */
#successStatus h2 {
    margin: 0;
    padding: 0;
}

#successStatus p {
    margin: 5px 0 20px 0;
}

/* 移除返回首页按钮的样式 */
#verifyStatusPage .button {
    display: none;
}

/* 加载指示器样式 */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    width: 100%;
    margin: 50px auto;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3490dc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-indicator p {
    color: #666;
    font-size: 16px;
    font-weight: 500;
}