/* 通用最近测试结果组件样式 */

#test-history-nav { position: relative; display: inline-block; }
.test-history-section { display: none; width: 100%; max-width: 720px; margin: 1rem auto 1.5rem; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 16px; padding: 1rem 1.25rem; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #fff; }
.test-history-section.show { display: block; }
.test-history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.test-history-title { font-size: 0.95rem; font-weight: 600; opacity: 0.92; display: flex; align-items: center; gap: 0.4rem; }
.test-history-link { font-size: 0.8rem; color: rgba(255, 255, 255, 0.75); text-decoration: none; cursor: pointer; transition: color 0.2s; }
.test-history-link:hover { color: #fff; text-decoration: underline; }
.test-history-card { display: flex; align-items: center; gap: 0.85rem; background: rgba(255, 255, 255, 0.06); border-radius: 12px; padding: 0.85rem 1rem; border: 1px solid rgba(255, 255, 255, 0.08); }
.test-history-emoji { font-size: 2rem; line-height: 1; flex-shrink: 0; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.08); border-radius: 12px; }
.test-history-emoji:empty::before { content: '📋'; opacity: 0.7; }
.test-history-info { flex: 1; min-width: 0; }
.test-history-test-name { font-size: 0.8rem; opacity: 0.75; margin-bottom: 0.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.test-history-result-name { font-size: 1.05rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.test-history-meta { font-size: 0.75rem; opacity: 0.65; margin-top: 0.2rem; }
.test-history-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.test-history-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.45rem 0.8rem; border-radius: 8px; font-size: 0.8rem; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: all 0.2s; white-space: nowrap; }
.test-history-btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; border-color: transparent; }
.test-history-btn-primary:hover { opacity: 0.9; color: #fff; }
.test-history-btn-secondary { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.9); border-color: rgba(255, 255, 255, 0.15); }
.test-history-btn-secondary:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

/* 弹窗 */
.test-history-modal { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(0, 0, 0, 0.65); align-items: center; justify-content: center; padding: 1rem; }
.test-history-modal.show { display: flex; }
.test-history-modal-content { width: 100%; max-width: 560px; max-height: 80vh; background: #1a1d29; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.1); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4); }
.test-history-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.test-history-modal-title { font-size: 1.1rem; font-weight: 700; color: #fff; margin: 0; }
.test-history-modal-close { background: none; border: none; color: rgba(255, 255, 255, 0.7); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.test-history-modal-body { flex: 1; overflow-y: auto; padding: 0.5rem 1rem; }
.test-history-modal-footer { display: flex; justify-content: space-between; gap: 0.75rem; padding: 1rem 1.25rem; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.test-history-empty { text-align: center; color: rgba(255, 255, 255, 0.6); padding: 2rem 1rem; font-size: 0.9rem; }
.test-history-list { display: flex; flex-direction: column; gap: 0.6rem; }
.test-history-item { display: flex; align-items: center; gap: 0.25rem; padding: 0.75rem; background: rgba(255, 255, 255, 0.04); border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.06); color: #fff; transition: background 0.2s, border-color 0.2s; }
.test-history-item:hover { background: rgba(255, 255, 255, 0.08); }
.test-history-item.is-abandoned { background: rgba(244, 67, 54, 0.06); border-color: rgba(244, 67, 54, 0.25); }
.test-history-item.is-abandoned:hover { background: rgba(244, 67, 54, 0.1); }
.test-history-item-main { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; color: #fff; text-decoration: none; }
.test-history-item-emoji { font-size: 1.5rem; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.08); border-radius: 10px; flex-shrink: 0; }
.test-history-item-info { flex: 1; min-width: 0; }
.test-history-item-title { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.test-history-item-sub { font-size: 0.75rem; opacity: 0.65; margin-top: 0.1rem; }
.test-history-item-detail { font-size: 0.7rem; opacity: 0.55; margin-top: 0.15rem; }
.test-history-item-detail .status-success { color: #81c784; }
.test-history-item-detail .status-danger { color: #ff5252; font-weight: 700; }
.test-history-item-detail .status-info { color: #90caf9; }
.test-history-item-testname { color: #fff; }
.test-history-item-sep { opacity: 0.4; margin: 0 0.15rem; }
.test-history-item-resultname { color: #7c8cff; font-weight: 800; text-shadow: 0 0 8px rgba(124, 140, 255, 0.25); }
.test-history-item-retest { display: inline-flex; align-items: center; justify-content: center; padding: 0.35rem 0.65rem; border-radius: 8px; font-size: 0.72rem; font-weight: 600; color: rgba(255, 255, 255, 0.85); background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); text-decoration: none; transition: all 0.2s; flex-shrink: 0; }
.test-history-item-retest:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.test-history-source-badge { display: inline-flex; align-items: center; padding: 0.05rem 0.35rem; border-radius: 999px; font-size: 0.65rem; font-weight: 600; border: 1px solid rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.9); }
.test-history-source-badge.source-pyg { background: rgba(156, 39, 176, 0.18); border-color: rgba(156, 39, 176, 0.45); color: #e1bee7; }
.test-history-source-badge.source-q { background: rgba(233, 30, 99, 0.18); border-color: rgba(233, 30, 99, 0.45); color: #f8bbd0; }
.test-history-source-badge.source-one { background: rgba(255, 152, 0, 0.18); border-color: rgba(255, 152, 0, 0.45); color: #ffe0b2; }
.test-history-source-badge.source-frontend { background: rgba(0, 188, 212, 0.18); border-color: rgba(0, 188, 212, 0.45); color: #b2ebf2; }
.test-history-source-badge.source-default { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.85); }
.test-history-clear { background: transparent; border: 1px solid rgba(244, 67, 54, 0.5); color: #f44336; padding: 0.45rem 0.8rem; border-radius: 8px; cursor: pointer; font-size: 0.8rem; transition: all 0.2s; }
.test-history-clear:hover { background: rgba(244, 67, 54, 0.1); }

/* 顶部导航已测/未测小徽章 */
.test-history-nav-badge { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 0.25rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; cursor: pointer; user-select: none; transition: all 0.2s; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.9); }
.test-history-nav-badge:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.test-history-nav-badge.has-records { background: rgba(102, 126, 234, 0.22); border-color: rgba(102, 126, 234, 0.45); color: #e0e4ff; }
.test-history-nav-badge.has-records:hover { background: rgba(102, 126, 234, 0.32); }
.test-history-nav-badge.is-tested { background: rgba(76, 175, 80, 0.2); border-color: rgba(76, 175, 80, 0.45); color: #c8e6c9; }
.test-history-nav-badge.is-tested:hover { background: rgba(76, 175, 80, 0.3); }
.test-history-nav-popup { display: none; position: absolute; top: calc(100% + 0.6rem); right: 0; width: 320px; max-width: 90vw; background: #1a1d29; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 14px; padding: 0.85rem; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45); z-index: 10000; }
.test-history-nav-popup.show { display: block; }
.test-history-nav-popup::before { content: ''; position: absolute; top: -6px; right: 1rem; width: 12px; height: 12px; background: #1a1d29; border-left: 1px solid rgba(255, 255, 255, 0.1); border-top: 1px solid rgba(255, 255, 255, 0.1); transform: rotate(45deg); }
.test-history-nav-popup-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.6rem; color: #fff; }
.test-history-nav-popup-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 360px; overflow-y: auto; }
.test-history-nav-popup-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem; border-radius: 10px; background: rgba(255, 255, 255, 0.04); color: #fff; text-decoration: none; transition: background 0.2s; }
.test-history-nav-popup-item:hover { background: rgba(255, 255, 255, 0.09); }
.test-history-nav-popup-item.current { background: rgba(102, 126, 234, 0.18); border: 1px solid rgba(102, 126, 234, 0.35); }
.test-history-nav-popup-emoji { font-size: 1.3rem; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.08); border-radius: 8px; flex-shrink: 0; }
.test-history-nav-popup-info { flex: 1; min-width: 0; }
.test-history-nav-popup-name { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.test-history-nav-popup-testname { color: #fff; }
.test-history-nav-popup-sep { opacity: 0.4; margin: 0 0.1rem; }
.test-history-nav-popup-resultname { color: #a5b4fc; font-weight: 700; }
.test-history-nav-popup-sub { font-size: 0.7rem; opacity: 0.65; margin-top: 0.05rem; }
.test-history-nav-popup-sub .test-history-source-badge { vertical-align: middle; margin-top: -1px; }
.test-history-nav-popup-empty { text-align: center; color: rgba(255, 255, 255, 0.55); padding: 1.2rem 0.5rem; font-size: 0.82rem; }
.test-history-nav-popup-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.7rem; padding-top: 0.6rem; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.test-history-nav-popup-viewall { font-size: 0.78rem; color: rgba(255, 255, 255, 0.75); text-decoration: none; }
.test-history-nav-popup-viewall:hover { color: #fff; text-decoration: underline; }
.test-history-nav-popup-clear { font-size: 0.78rem; color: #f44336; background: none; border: none; cursor: pointer; }

@media (max-width: 640px) {
    .test-history-section { margin: 0.75rem; width: auto; max-width: none; }
    .test-history-card { flex-wrap: wrap; }
    .test-history-actions { width: 100%; margin-top: 0.75rem; }
    .test-history-actions .test-history-btn { flex: 1; }
    .test-history-modal-content { max-height: 90vh; }
    .test-history-nav-popup { right: -0.5rem; width: 300px; }
}
