/* 发现日志区域样式 - 优化版 */

/* --- 基础与通用 --- */
.discovery-logs-wrapper {
    margin: 2rem 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.required {
    color: #dc3545;
    font-weight: 700;
}

/* --- 日志列表标题与统计 --- */
.logs-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #2c5530;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.logs-title .icon-treasure::before {
    content: '🏴‍☠️';
}

.cache-name {
    font-weight: 400;
    font-size: 1rem;
    color: #666;
    margin-left: .5rem;
}

.logs-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border-radius: 12px;
    border: 1px solid #d4edda;
    flex-wrap: wrap; /* 允许在小屏幕上换行 */
}

.stats-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
    flex-grow: 1; /* 让项目在 flex 容器中可以伸展 */
    min-width: 150px;
}

.stats-item.found {
    border-left: 4px solid #28a745;
}

.stats-item.not-found {
    border-left: 4px solid #dc3545;
}

.stats-item.total {
    border-left: 4px solid #007bff;
}

.stats-icon {
    font-size: 1.2rem;
}

.stats-label {
    font-size: .9rem;
    color: #666;
}

.stats-count {
    font-weight: 700;
    font-size: 1.2rem;
    color: #333;
    margin-left: auto;
}

/* --- 日志列表样式 --- */
.discovery-logs-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.discovery-log {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    transition: all .3s ease;
    position: relative;
    animation: fadeInUp .5s ease;
}

.discovery-log:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
    transform: translateY(-2px);
}

.discovery-log.found {
    border-left: 5px solid #28a745;
    background: linear-gradient(135deg, #fff 0%, #f8fff8 100%);
}

.discovery-log.not-found {
    border-left: 5px solid #dc3545;
    background: linear-gradient(135deg, #fff 0%, #fff8f8 100%);
}

.log-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.log-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.log-author .avatar {
    border-radius: 50%;
    border: 3px solid #ddd;
}

.log-author-info h4,
.log-author-info .author-name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c5530;
    text-decoration: none;
}

.log-author-info .author-name:hover {
    text-decoration: underline;
}

.log-date {
    color: #666;
    font-size: .9rem;
    margin-top: .25rem;
}

.log-date a {
    color: inherit;
    text-decoration: none;
}

.discovery-status {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.status-badge {
    padding: .5rem 1rem;
    border-radius: 20px;
    font-size: .9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #fff;
}

.status-badge.found {
    background: #28a745;
}

.status-badge.not-found {
    background: #dc3545;
}

.log-content {
    line-height: 1.7;
    margin-bottom: 1rem;
    color: #333;
    font-size: 1rem;
    word-wrap: break-word;
}

.comment-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 1rem;
}

.log-awaiting-moderation {
    background: #fff3cd;
    color: #856404;
    padding: .75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: inline-block;
    border: 1px solid #ffeaa7;
}

.log-reply-link-wrapper a {
    display: inline-block;
    padding: .5rem 1rem;
    background: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: .9rem;
    transition: background .3s ease;
}

.log-reply-link-wrapper a:hover {
    background: #0056b3;
}


/* --- 评论表单样式 --- */
.discovery-log-form-wrapper {
    margin-top: 3rem;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .1);
    border: 1px solid #e9ecef;
}

.form-title {
    color: #2c5530;
    font-size: 1.5rem;
    margin: 0 0 1.5rem 0; /* 调整标题下间距 */
    display: flex;
    align-items: center;
    gap: .5rem;
}

.form-title .icon-edit::before {
    content: '📝';
}

/* === 关键改动：欢迎信息样式 === */
.logged-in-as {
    display: flex;
    flex-wrap: wrap; /* 允许换行 */
    align-items: center;
    gap: 0.25rem 0.75rem; /* 行间距和列间距 */
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.logged-in-as a {
    font-weight: 600;
}

/* === 关键改动：寻宝结果字段样式 === */
.discovery-status-field {
    margin-bottom: 1.5rem; /* 减小与下方元素的间距 */
}

.discovery-status-label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.status-options {
    display: grid; /* 使用 Grid 布局，更灵活 */
    grid-template-columns: repeat(2, 1fr); /* 创建两列，每列占据一半空间 */
    gap: 1rem; /* 设置选项之间的间距 */
}

.status-option {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all .3s ease;
}

.status-option:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.status-option input[type=radio] {
    flex-shrink: 0; /* 防止单选框在 flex 布局中被压缩 */
    margin: 0;
    width: 20px;
    height: 20px;
    accent-color: #007bff;
}

.status-option.found:has(input:checked) {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.status-option.not-found:has(input:checked) {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.status-icon {
    font-size: 1.2rem;
}

.status-text {
    font-size: 1rem;
    font-weight: 500;
}
.status-option input[type=radio]:checked + .status-icon + .status-text {
    font-weight: 700;
}

/* --- 其他表单字段样式 --- */
.log-form-field {
    margin-bottom: 1.5rem;
}

.log-form-comment {
    position: relative;
    margin-bottom: 1.5rem;
}

.comment-toolbar {
    position: absolute;
    top: 2.5rem;
    right: .5rem;
    z-index: 10;
}

.comment-toolbar i {
    font-size: 1.5rem;
    color: #888;
    cursor: pointer;
    transition: color .3s;
}

.comment-toolbar i:hover {
    color: #333;
}

.discovery-log-form label {
    display: block;
    margin-bottom: .5rem;
    font-weight: 600;
    color: #333;
}

.discovery-log-form input[type=text],
.discovery-log-form input[type=email],
.discovery-log-form input[type=url],
.discovery-log-form textarea {
    width: 100%;
    padding: .75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color .3s ease, box-shadow .3s ease;
    box-sizing: border-box;
}

.discovery-log-form input[type=file] {
    width: 100%;
    font-size: .9rem;
    color: #555;
}

.discovery-log-form input[type=text]:focus,
.discovery-log-form input[type=email]:focus,
.discovery-log-form input[type=url]:focus,
.discovery-log-form textarea:focus {
    outline: 0;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, .1);
}

.discovery-log-form textarea {
    resize: vertical;
    min-height: 150px;
    font-family: inherit;
    padding-right: 2.5rem;
}

.log-tips {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.log-tips p {
    margin: 0 0 .5rem;
    color: #495057;
    font-weight: 600;
}

.log-tips ul {
    margin: 0;
    padding-left: 1.5rem;
}

.log-tips li {
    margin-bottom: .5rem;
    color: #666;
    line-height: 1.4;
}

.form-submit {
    margin-top: 1rem; /* 调整提交按钮上间距 */
}

.log-submit {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, .3);
    width: 100%; /* 让按钮宽度充满容器 */
}

.log-submit:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, .4);
}

.char-counter {
    text-align: right;
    font-size: .8rem;
    color: #666;
    margin-top: .5rem;
    padding: .25rem 0;
}


/* --- 导航与动画 --- */
.logs-navigation {
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid #e9ecef;
}

.logs-navigation .nav-links {
    display: flex;
    justify-content: space-between;
}

.logs-navigation a {
    padding: .75rem 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    transition: all .3s ease;
    font-weight: 500;
}

.logs-navigation a:hover {
    background: #007bff;
    color: #fff;
}

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


/* --- 移动端响应式样式 --- */
@media (max-width: 768px) {
    .logs-stats,
    .logs-navigation .nav-links {
        flex-direction: column;
        gap: .5rem;
    }

    .log-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .discovery-log-form-wrapper {
        padding: 1.5rem 1rem; /* 调整内边距 */
    }

    /* 这里的改动使得“寻宝结果”在移动端依然保持一行两列 */
    /* 由于我们上面使用了 Grid 布局，这里无需额外代码，它会自动适应 */
}

@media (max-width: 480px) {
    /* 针对更小的屏幕进行微调 */
    .status-option {
        padding: 0.75rem; /* 减小内边距 */
        gap: 0.5rem;
    }
    .status-text {
        font-size: 0.9rem; /* 减小字体 */
    }
}