@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* 隐藏顶部汽车动画（全局） - 多种可能的选择器 */
.night-drive-header,
[class*="night"],
[class*="drive"],
[class*="animation-header"],
[class*="top-animation"],
header[class*="animation"],
div[class*="night-"],
div[class*="-drive"],
canvas[style*="position: fixed"],
canvas[style*="position: absolute"][style*="top: 0"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* 防止页面出现横向滚动条 */
html, body {
	overflow-x: hidden;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #fff; /* 恢复为白色背景 */
}

a, .btn-link {
    color: #0366d6;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

/* 调整页面内容适应页眉和底部导航栏 */
.content, 
.container, 
.main-content,
.page,
.page-content {
    padding-top: 12px; /* 保持顶部间距 */
    padding-bottom: 0px; /* 为底部导航栏留出空间 */
}

/* 当页面使用container时的边距 */
.container {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 1000px; /* 适中的内容宽度 */
    margin: 0 auto;
}

/* Instagram风格的卡片 */
.card, .question-card {
    border-radius: 3px;
    border: 1px solid #dbdbdb;
    margin-bottom: 5px;
    background-color: white;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    bottom: 60px;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    display: none;
    left: 0;
    padding: 1rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 1rem;
        top: 0.5rem;
        font-weight: bold;
    }

/* 富文本编辑器相关样式 */

.rich-text-editor-container {
    border-radius: 4px;
}

.ql-editor {
    min-height: 200px;
}

.ql-image {
    position: relative;
}

/* 问题内容样式 */
.question-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 8px 0;
}

.question-content p {
    margin-bottom: 1rem;
}

.question-content h1, 
.question-content h2, 
.question-content h3, 
.question-content h4, 
.question-content h5, 
.question-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.question-content pre {
    background-color: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    margin: 12px 0;
    overflow-x: auto;
}

.question-content code {
    font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
    background-color: #f0f0f0;
    padding: 2px 4px;
    border-radius: 4px;
}

.question-content blockquote {
    border-left: 4px solid #ccc;
    margin-left: 0;
    padding-left: 16px;
    color: #666;
}

.question-content ul, 
.question-content ol {
    padding-left: 22px;
}

.question-content a {
    color: #1890ff;
    text-decoration: none;
}

.question-content a:hover {
    text-decoration: underline;
}

/* 添加RichTextEditor所需的样式 */
.quill-editor {
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}

.quill-editor .toolbar {
    border-bottom: 1px solid #ccc;
    background-color: #f8f9fa;
    padding: 8px;
}

.quill-editor .editor-content {
    min-height: 200px;
    padding: 10px;
}

.ql-formats {
    display: inline-block;
    margin-right: 15px;
}

/* 按钮样式修复 - 确保文本正确显示 */
.btn {
    white-space: nowrap !important;
    text-align: center !important;
    display: inline-block !important;
    writing-mode: horizontal-tb !important;
    word-break: normal !important;
    letter-spacing: normal !important;
}

/* 修复评论按钮样式问题 */
.btn-outline-primary, 
.btn-primary,
button {
    min-width: 40px;
    word-spacing: normal !important;
}

/* 特别修复独立评论按钮样式 */
.comment-btn,
[class*="评论"],
button:contains("评论"),
.float-comment-btn,
.fixed-comment-btn {
    writing-mode: horizontal-tb !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 修复字符间距问题 */
* {
    letter-spacing: normal !important;
}

/* 高亮元素样式（全局无限循环） */
.highlight-element {
    animation: highlight-pulse 2.4s ease-in-out infinite;
    animation-play-state: running !important;
    border-radius: 4px;
}

@keyframes highlight-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 105, 180, 0.18); background-color: rgba(255, 182, 193, 0.10); }
    50% { box-shadow: 0 0 0 14px rgba(255, 105, 180, 0.14); background-color: rgba(255, 182, 193, 0.16); }
    100% { box-shadow: 0 0 0 0 rgba(255, 105, 180, 0); background-color: rgba(255, 182, 193, 0); }
}

/* 登录弹框样式 - Instagram风格 */
.login-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: overlay-fade-in 0.2s ease-out;
}

@keyframes overlay-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.login-popup-overlay.closing {
    animation: overlay-fade-out 0.15s ease-in forwards;
}

@keyframes overlay-fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.login-popup {
    background: white;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: popup-fade-in 0.2s ease-out;
}

@keyframes popup-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-popup.closing {
    animation: popup-fade-out 0.15s ease-in forwards;
}

@keyframes popup-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.popup-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid #dbdbdb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #262626;
}

.btn-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #8e8e8e;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-close:hover {
    color: #262626;
    transform: scale(1.1);
}

.popup-body {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.popup-content {
    line-height: 1.6;
    color: #262626;
    font-size: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* 当内容包含HTML标签时的样式 */
.popup-content:has(> *) {
    white-space: normal;
}

.popup-content > * {
    white-space: pre-wrap;
}

.popup-content h1, .popup-content h2, .popup-content h3 {
    color: #262626;
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 16px;
}

.popup-content p {
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.popup-content ul, .popup-content ol {
    margin-bottom: 12px;
    padding-left: 16px;
    white-space: pre-wrap;
}

.popup-content li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.popup-content code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.popup-content pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.popup-footer {
    padding: 12px 16px 16px;
    border-top: 1px solid #dbdbdb;
    text-align: center;
}

.popup-footer .btn {
    min-width: 80px;
    padding: 6px 16px;
    font-weight: 600;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.popup-footer .btn:hover {
    background-color: #0081d6;
}

/* 弹框管理页面样式 */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

.badge {
    font-size: 0.75rem;
}

.bg-purple {
    background-color: #6f42c1 !important;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* 响应式弹框 */
@media (max-width: 576px) {
    .login-popup {
        width: 95%;
        margin: 10px;
    }
    
    .popup-header {
        padding: 15px;
    }
    
    .popup-body {
        padding: 15px;
    }
    
    .popup-footer {
        padding: 15px;
    }
    
    .popup-title {
        font-size: 1.1rem;
    }
}

/* 最佳回答样式 */
.best-answer-badge .badge {
    font-size: 0.85rem;
    padding: 6px 10px;
}

.answer-card.is-accepted {
    border: 3px solid #ffd700;
    background-color: rgba(255, 215, 0, 0.08);
    position: relative;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.15);
}

/* 头像容器样式 */
.avatar-container {
    position: relative;
    display: inline-block;
}

/* 最佳答案徽章样式 */
.best-answer-badge {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%) perspective(100px) rotateX(15deg) rotateY(-20deg);
    background: transparent;
    color: #ffd700;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    z-index: 10;
    text-shadow: 
        2px 2px 0px #b8860b,
        4px 4px 0px #8b6914,
        6px 6px 0px #654321,
        0 0 8px rgba(255, 215, 0, 0.6);
    letter-spacing: 1px;
    font-family: 'Arial Black', Arial, sans-serif;
    text-transform: uppercase;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

/* 皇冠图标样式 */
.crown-icon {
    position: absolute;
    top: -12px;
    left: 20px;
    color: #FFD700;
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
    transform: rotate(-10deg);
    z-index: 2;
    animation: shine 2s infinite alternate;
}

/* 最佳回答丝带 */
.best-answer-ribbon {
    position: absolute;
    top: 10px;
    right: -5px;
    z-index: 2;
    overflow: hidden;
    width: 110px;
    height: 110px;
}

.best-answer-ribbon span {
    position: absolute;
    display: block;
    width: 160px;
    padding: 5px 0;
    background-color: #FFD700;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    color: #000;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    transform: rotate(45deg);
    right: -40px;
    top: 25px;
}

.best-answer-ribbon span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 100%;
    z-index: -1;
    border-left: 3px solid #FFD700;
    border-right: 3px solid transparent;
    border-bottom: 3px solid transparent;
    border-top: 3px solid #FFD700;
}

.best-answer-ribbon span::after {
    content: "";
    position: absolute;
    right: 0;
    top: 100%;
    z-index: -1;
    border-left: 3px solid transparent;
    border-right: 3px solid #FFD700;
    border-bottom: 3px solid transparent;
    border-top: 3px solid #FFD700;
}

@keyframes shine {
    from { text-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
    to { text-shadow: 0 0 15px rgba(255, 215, 0, 0.8); }
}

/* 最佳回答皇冠图片样式 */
.best-crown-image {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 35px;
    height: 35px;
}

.best-crown-image.hide {
    display: none;
}

.best-crown-image.show {
    display: block;
}

.best-crown-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* 举报管理页面样式 */
.reports-container {
    max-width: 100%;
    padding: 16px;
    background: #f8f9fa;
    min-height: 100vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-title i {
    color: #e53e3e;
    font-size: 1.25rem;
}

.refresh-btn {
    background: #3182ce;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: #2c5aa0;
    transform: translateY(-1px);
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p {
    color: #718096;
    margin: 0;
}

/* 错误信息 */
.error-message {
    background: #fed7d7;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.empty-state i {
    font-size: 3rem;
    color: #a0aec0;
    margin-bottom: 16px;
}

.empty-state h3 {
    color: #4a5568;
    margin-bottom: 8px;
}

.empty-state p {
    color: #718096;
    margin: 0;
}

/* 举报列表 */
.reports-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.report-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

/* 状态栏 */
.status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.status-badge, .type-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
}

.status-pending {
    background: #d69e2e;
}

.status-approved {
    background: #e53e3e;
}

.status-rejected {
    background: #718096;
}

.status-unknown {
    background: #a0aec0;
}

.type-question {
    background: #3182ce;
}

.type-answer {
    background: #38a169;
}

.type-experience {
    background: #d69e2e;
}

.type-unknown {
    background: #a0aec0;
}

.time-stamp {
    margin-left: auto;
    color: #718096;
    font-size: 0.85rem;
}

/* 举报信息 */
.report-info {
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    gap: 16px;
}

.info-col {
    flex: 1;
}

.info-col label {
    display: block;
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 4px;
    font-weight: 500;
}

.user-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

/* 举报原因 */
.reason-section {
    margin-bottom: 16px;
}

.reason-section label {
    display: block;
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 8px;
    font-weight: 500;
}

.reason-text {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 12px;
    color: #c53030;
    font-weight: 500;
    word-break: break-word;
}

.reason-detail {
    margin-top: 8px;
    color: #718096;
    font-size: 0.9rem;
    font-style: italic;
}

/* 被举报内容 */
.content-section {
    margin-bottom: 16px;
}

.content-section label {
    display: block;
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 8px;
    font-weight: 500;
}

.content-preview {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
}

.content-type {
    display: inline-block;
    background: #edf2f7;
    color: #4a5568;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 8px;
}

.content-text {
    color: #2d3748;
    line-height: 1.5;
    word-break: break-word;
}

/* 处理信息 */
.process-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.process-info label {
    display: block;
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 8px;
    font-weight: 500;
}

.process-details {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.process-time, .process-admin {
    color: #2b6cb0;
    font-size: 0.9rem;
}

.admin-comment {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    color: #4a5568;
    font-style: italic;
    line-height: 1.4;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .reports-container {
        padding: 12px;
    }
    
    .page-header {
        padding: 12px;
        margin-bottom: 16px;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .page-title {
        font-size: 1.25rem;
        justify-content: center;
    }
    
    .refresh-btn {
        align-self: center;
    }
    
    .report-item {
        padding: 16px;
    }
    
    .status-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .time-stamp {
        margin-left: 0;
    }
    
    .info-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .process-details {
        flex-direction: column;
        gap: 8px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 576px) {
    .reports-container {
        padding: 8px;
    }
    
    .report-item {
        padding: 12px;
        border-radius: 8px;
    }
    
    .status-badge, .type-badge {
        font-size: 0.75rem;
        padding: 3px 10px;
    }
    
    .reason-text, .content-preview, .process-info {
        padding: 12px;
    }
    
    .page-title {
        font-size: 1.1rem;
    }
}

/* 举报管理 tabs */
.status-tabs {
    display: flex;
    gap: 8px;
    margin: 8px 0 16px;
}
.tab-btn {
    background: #edf2f7;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
}
.tab-btn.active {
    background: #3182ce;
    color: #fff;
    border-color: #3182ce;
}
@media (max-width: 768px) {
    .status-tabs { flex-wrap: wrap; }
    .tab-btn { flex: 1; text-align: center; }
}

/* 隐藏Blazor reconnect UI */
.blazor-error-ui,
.blazor-error-boundary,
#blazor-error-ui,
.blazor-reconnect-modal,
.blazor-reconnect-dialog {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* 隐藏重连相关的所有元素 */
[data-blazor-error-boundary],
.blazor-reconnect,
.blazor-reconnect-modal,
.blazor-reconnect-dialog,
.blazor-reconnect-error,
.blazor-reconnect-retry,
.blazor-reconnect-cancel {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* 增强隐藏规则 - 覆盖.NET 9.0的新reconnect UI */
.blazor-reconnect-display,
.blazor-reconnect-status,
.blazor-reconnect-progress,
.blazor-reconnect-button,
.blazor-reconnect-message,
.blazor-reconnect-countdown,
.blazor-reconnect-spinner,
.blazor-reconnect-icon,
.blazor-reconnect-text,
.blazor-reconnect-container {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* 隐藏可能的模态框背景 */
.blazor-reconnect-overlay,
.blazor-reconnect-backdrop,
.blazor-reconnect-wrapper {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* 强制隐藏所有包含reconnect相关文本的元素 */
[class*="reconnect"],
[class*="blazor-error"],
[id*="reconnect"],
[id*="blazor-error"] {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* 删除按钮完全靠右样式 */
.delete-button-container {
	display: flex !important;
	justify-content: flex-end !important;
	align-items: center !important;
	width: 100% !important;
	margin-bottom: 0.5rem !important;
}

.delete-button-container .btn {
	margin-left: auto !important;
	margin-right: 0 !important;
}