/* 弹出框和模态框样式 */

/* 模态框遮罩层 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(8px);
    padding: 1rem;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 靶场详情模态框 */
.target-detail-modal {
    background: var(--secondary-color);
    border-radius: 16px;
    max-width: 1000px;
    width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(90, 122, 138, 0.2);
    transform: scale(0.95) translateY(30px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(90, 122, 138, 0.25);
    position: relative;
    overflow: hidden;
}

.target-detail-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #5a7a8a, #8b7aa3, #c9a876);
    border-radius: 16px 16px 0 0;
    z-index: 1;
}

.target-detail-modal.show {
    transform: scale(1) translateY(0);
}

/* 模态框头部 */
.modal-header {
    padding: 1.8rem 2rem 1.5rem;
    border-bottom: 1px solid rgba(90, 122, 138, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(90, 122, 138, 0.08), rgba(139, 122, 163, 0.05));
    position: relative;
    z-index: 2;
    gap: 1rem;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-header h2 i {
    color: #5a7a8a;
    filter: drop-shadow(0 0 6px rgba(90, 122, 138, 0.4));
    font-size: 1.4rem;
}

.modal-close {
    background: rgba(90, 122, 138, 0.1);
    border: 1px solid rgba(90, 122, 138, 0.2);
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    backdrop-filter: blur(5px);
    position: relative;
    z-index: 5;
}

.modal-close:hover {
    background: rgba(90, 122, 138, 0.2);
    color: #5a7a8a;
    transform: scale(1.08);
    border-color: rgba(90, 122, 138, 0.4);
    box-shadow: 0 4px 12px rgba(90, 122, 138, 0.2);
}

/* 模态框内容区域 */
.modal-content {
    padding: 2.5rem;
    position: relative;
    z-index: 1;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    background: linear-gradient(135deg, rgba(26, 31, 54, 0.95), rgba(15, 18, 37, 0.98));
}

/* 美化模态框内容滚动条 */
.modal-content::-webkit-scrollbar {
    width: 10px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(90, 122, 138, 0.1);
    border-radius: 6px;
    margin: 8px 0;
}

.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #5a7a8a, #8b7aa3);
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background-clip: content-box;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #4a6a7a, #7b6a93);
}

/* 模态框主体布局 */
.modal-body {
    display: flex;
    gap: 2.5rem;
    min-height: 450px;
    margin-bottom: 0;
    align-items: flex-start;
}

.modal-left {
    flex: 0 0 340px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 左侧区域样式优化 */
.modal-left .detail-item {
    background: linear-gradient(135deg, rgba(90, 122, 138, 0.12), rgba(139, 122, 163, 0.08));
    padding: 1.5rem;
    border-radius: 14px;
    border: 1px solid rgba(90, 122, 138, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.modal-left .detail-item:hover {
    transform: translateX(3px) translateY(-2px);
    border-color: rgba(90, 122, 138, 0.4);
    box-shadow: 0 8px 24px rgba(90, 122, 138, 0.15);
    background: linear-gradient(135deg, rgba(90, 122, 138, 0.18), rgba(139, 122, 163, 0.12));
}

/* 右侧描述区域样式优化 */
.modal-right .description-item {
    background: linear-gradient(135deg, rgba(90, 122, 138, 0.12), rgba(139, 122, 163, 0.08));
    border: 1px solid rgba(90, 122, 138, 0.2);
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 3rem;
    border-radius: 14px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    flex: 1;
    height: 100%;
}

/* 描述标题和按钮行 */
.description-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.3rem;
    flex-shrink: 0;
    position: relative;
}

.description-header h3 {
    margin: 0;
    flex: 1;
}

/* 查看攻略按钮 */
.walkthrough-btn {
    background: #007bff;
    color: white;
    padding: 0.45rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(0, 123, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.25);
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    /* 固定宽度和水平对齐设置 */
    width: 120px;
    min-width: 120px;
    justify-content: center;
    margin-right: 1.4rem; /* 与描述文字右边缘对齐 */
}

.walkthrough-btn:hover:not([href="#"]) {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.35);
    text-decoration: none;
}

.walkthrough-btn:active:not([href="#"]) {
    transform: translateY(0);
}

/* 禁用状态 */
.walkthrough-btn[href="#"] {
    background: #6c757d;
    color: #adb5bd;
    cursor: not-allowed;
    border-color: rgba(108, 117, 125, 0.3);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.25);
}

.walkthrough-btn[href="#"]:hover {
    transform: none;
}


.modal-right .description-item h3 {
    margin-bottom: 1.2rem;
    flex-shrink: 0;
}

.modal-right .description-text {
    flex: 1;
    min-height: 650px;
    max-height: 650px;
    height: auto;
    overflow-y: auto;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(90, 122, 138, 0.6) rgba(15, 18, 37, 0.2);
}

/* 通用detail-item样式优化 */
.detail-item {
    position: relative;
    overflow: hidden;
}

.detail-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #5a7a8a, #8b7aa3);
    opacity: 0;
    transition: all 0.3s ease;
    border-radius: 0 2px 2px 0;
}

.detail-item:hover::before {
    opacity: 1;
}

.detail-item h3 {
    margin: 0 0 1.2rem 0;
    color: #5a7a8a;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.detail-item h3 i {
    filter: drop-shadow(0 0 4px rgba(90, 122, 138, 0.4));
    font-size: 1.1rem;
}

/* IP地址显示容器 */
.ip-addresses-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 0;
}

.ip-address-item {
    background: linear-gradient(135deg, rgba(90, 122, 138, 0.12), rgba(139, 122, 163, 0.08));
    border: 1px solid rgba(90, 122, 138, 0.2);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ip-address-item:hover {
    background: linear-gradient(135deg, rgba(90, 122, 138, 0.18), rgba(139, 122, 163, 0.12));
    border-color: rgba(90, 122, 138, 0.35);
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(90, 122, 138, 0.15);
}

.ip-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0;
    color: #5a7a8a;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    min-width: 80px;
}

.ip-label i {
    font-size: 0.75rem;
    filter: drop-shadow(0 0 3px rgba(90, 122, 138, 0.4));
}

.ip-value {
    color: var(--text-color);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    background: rgba(26, 31, 54, 0.6);
    padding: 0.4rem 0.75rem;
    border-radius: 5px;
    border: 1px solid rgba(90, 122, 138, 0.15);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.3px;
    word-break: break-all;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    flex: 1;
}

.ip-value.target-ip {
    border-left: 3px solid #5a7a8a;
}

.ip-value.vpn-ip {
    border-left: 3px solid #8b7aa3;
}

/* 兼容旧版IP地址显示 */
.ip-text {
    color: var(--text-color);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(135deg, rgba(90, 122, 138, 0.15), rgba(139, 122, 163, 0.10));
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    border: 1px solid rgba(90, 122, 138, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
    backdrop-filter: blur(5px);
}

/* 描述文本内容 */
.description-text {
    color: var(--text-color);
    line-height: 1.75;
    margin: 0;
    background: linear-gradient(135deg, rgba(26, 31, 54, 0.95), rgba(15, 18, 37, 0.98));
    padding: 1.4rem;
    border-radius: 10px;
    border-left: 4px solid #5a7a8a;
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    word-break: break-word;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 0.95rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(90, 122, 138, 0.6) rgba(15, 18, 37, 0.2);
    scroll-behavior: smooth;
}

/* HTML内容样式优化 */
.description-text h1,
.description-text h2,
.description-text h3,
.description-text h4,
.description-text h5,
.description-text h6 {
    color: #5a7a8a;
    margin: 1.2rem 0 0.6rem 0;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.description-text h1 { font-size: 1.6rem; }
.description-text h2 { font-size: 1.4rem; }
.description-text h3 { font-size: 1.25rem; }
.description-text h4 { font-size: 1.15rem; }
.description-text h5 { font-size: 1.05rem; }
.description-text h6 { font-size: 0.95rem; }

.description-text p {
    margin: 0.9rem 0;
    line-height: 1.75;
}

.description-text ul,
.description-text ol {
    margin: 0.9rem 0;
    padding-left: 1.8rem;
}

.description-text li {
    margin: 0.4rem 0;
    line-height: 1.65;
}

.description-text a {
    color: #5a7a8a;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.description-text a:hover {
    color: #8b7aa3;
    border-bottom-color: #8b7aa3;
    text-shadow: 0 0 6px rgba(139, 122, 163, 0.3);
}

.description-text strong,
.description-text b {
    color: var(--text-color);
    font-weight: 600;
}

.description-text em,
.description-text i {
    color: var(--text-color);
    font-style: italic;
}

.description-text code {
    background: rgba(90, 122, 138, 0.15);
    color: #c9a876;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid rgba(90, 122, 138, 0.2);
    font-weight: 600;
}

.description-text pre {
    background: rgba(90, 122, 138, 0.1);
    color: var(--text-color);
    padding: 1.2rem;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid rgba(90, 122, 138, 0.2);
    margin: 1.2rem 0;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
}

.description-text pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85em;
    color: inherit;
    font-weight: normal;
}

.description-text blockquote {
    border-left: 4px solid #5a7a8a;
    margin: 1.2rem 0;
    padding: 1rem 1.4rem;
    background: rgba(90, 122, 138, 0.08);
    font-style: italic;
    color: rgba(224, 224, 224, 0.9);
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.description-text hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    margin: 1.5rem 0;
}

.description-text img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    margin: 0.5rem 0;
}

.description-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.description-text th,
.description-text td {
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.description-text th {
    background: var(--light-color);
    color: var(--text-color);
    font-weight: 600;
}

.description-text td {
    background: var(--secondary-color);
}

/* 美化滚动条样式 */
.description-text::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.description-text::-webkit-scrollbar-track {
    background: rgba(15, 18, 37, 0.3);
    border-radius: 6px;
    margin: 4px 0;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.15);
}

.description-text::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #5a7a8a, #8b7aa3);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.description-text::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #6a8a9a, #9b8ab3);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.description-text::-webkit-scrollbar-corner {
    background: rgba(15, 18, 37, 0.3);
}

/* Firefox 滚动条样式 */
.description-text {
    scrollbar-width: thin;
    scrollbar-color: #5a7a8a rgba(15, 18, 37, 0.3);
}

.description-item {
    background: var(--secondary-color);
}

/* 难度显示组件 */
.difficulty-display {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    width: 100%;
}

.difficulty-display .badge {
    flex-shrink: 0;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    margin: 0;
    height: 28px;
}

.stars-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(26, 31, 54, 0.5);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(90, 122, 138, 0.15);
    flex: 1;
    min-width: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stars-container .stars {
    display: flex;
    gap: 0.2rem;
}

.stars-container .stars i {
    color: var(--warning-color);
    font-size: 1rem;
}

/* 响应式设计 */
@media (max-width: 900px) and (min-width: 769px) {
    .difficulty-display {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }
    
    .difficulty-display .badge {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
        height: 26px;
    }
    
    .stars-container {
        padding: 0.5rem 0.7rem;
        flex: 1;
    }
}

@media (max-width: 768px) {
    .modal-overlay {
        padding: 0.75rem;
    }
    
    .target-detail-modal {
        max-width: 100%;
        max-height: 92vh;
        margin: 0;
        border-radius: 12px;
    }
    
    .target-detail-modal::before {
        border-radius: 12px 12px 0 0;
    }
    
    .modal-body {
        flex-direction: column;
        gap: 2rem;
        min-height: auto;
        margin-bottom: 0;
    }
    
    .modal-left {
        flex: none;
        width: 100%;
        gap: 1.25rem;
    }
    
    .modal-right {
        flex: none;
        width: 100%;
    }
    
    .modal-right .description-text {
        min-height: 300px;
        max-height: 300px;
        height: auto;
        overflow-y: auto;
    }
    
    /* 移动端描述标题区域 */
    .description-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }
    
    .walkthrough-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
        gap: 0.35rem;
        width: 100px;
        min-width: 100px;
        margin-right: 1.25rem; /* 平板版与描述文字右边缘对齐 */
    }
    
    .modal-header {
        padding: 1.5rem 2rem 1.25rem;
    }
    
    .modal-header h2 {
        font-size: 1.35rem;
    }
    
    .modal-content {
        padding: 2rem;
    }
    
    .modal-left .detail-item,
    .modal-right .detail-item {
        padding: 1.25rem;
    }
    
    .difficulty-display {
        flex-direction: row;
        align-items: center;
        gap: 0.4rem;
        flex-wrap: nowrap;
    }
    
    .difficulty-display .badge {
        align-self: center;
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .stars-container {
        padding: 0.5rem 0.7rem;
        width: 100%;
    }
    
    .stars-container .stars i {
        font-size: 0.9rem;
    }

    .ip-text {
        font-size: 1.05rem;
        padding: 0.7rem 1rem;
    }
    
    /* 移动端IP地址容器优化 */
    .ip-addresses-container {
        gap: 0.6rem;
    }
    
    .ip-address-item {
        padding: 0.6rem 0.8rem;
        gap: 0.6rem;
    }
    
    .ip-address-item:hover {
        transform: none;
    }
    
    .ip-label {
        font-size: 0.75rem;
        margin-bottom: 0;
        min-width: 70px;
    }
    
    .ip-value {
        font-size: 0.9rem;
        padding: 0.35rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 0.5rem;
    }
    
    .target-detail-modal {
        border-radius: 10px;
    }
    
    .target-detail-modal::before {
        border-radius: 10px 10px 0 0;
    }
    
    .modal-right .description-text {
        min-height: 220px;
        max-height: 220px;
        height: auto;
        overflow-y: auto;
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .walkthrough-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
        gap: 0.3rem;
        width: 90px;
        min-width: 90px;
        margin-right: 1rem; /* 手机版与描述文字右边缘对齐 */
    }
    
    .modal-header {
        padding: 1.25rem 1.5rem 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    .detail-item h3 {
        font-size: 1.05rem;
    }
    
    .difficulty-display {
        flex-direction: row;
        gap: 0.3rem;
    }
    
    .difficulty-display .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
        height: 24px;
    }
    
    .stars-container {
        padding: 0.35rem 0.5rem;
    }
    
    .stars-container .stars i {
        font-size: 0.8rem;
    }

    .modal-left .detail-item,
    .modal-right .detail-item {
        padding: 1rem;
    }
    
    .modal-close {
        width: 40px;
        height: 40px;
        padding: 0.6rem;
    }
    
    /* 小屏幕IP地址容器优化 */
    .ip-addresses-container {
        gap: 0.5rem;
    }
    
    .ip-address-item {
        padding: 0.5rem 0.7rem;
        gap: 0.5rem;
    }
    
    .ip-label {
        font-size: 0.7rem;
        margin-bottom: 0;
        min-width: 60px;
    }
    
    .ip-value {
        font-size: 0.85rem;
        padding: 0.3rem 0.5rem;
    }
}
