/* 简约蓝色主题 */
:root {
    --primary: #1a73e8;
    --primary-light: #4285f4;
    --primary-dark: #0d47a1;
    --background: #0a192f;
    --surface: #112240;
    --surface-light: #1e3a5f;
    --on-surface: #e6f1ff;
    --on-surface-secondary: #a8b2d1;
    --border: #233554;
    --success: #00c853;
    --error: #ff5252;
    --card-height: 120px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--background) 0%, #07162b 100%);
    color: var(--on-surface);
    min-width: 500px;
    max-height: 600px;
    padding: 20px;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0 5px;
    position: relative;
}

header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 10;
    background: transparent;
}

.title-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 5px;
    position: relative;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    color: var(--on-surface);
    letter-spacing: 0.5px;
    position: relative;
}

.breaker {
    font-weight: 800;
    font-size: 32px;
    position: relative;
    color: var(--primary-light);
    text-shadow: 0 0 10px rgba(66, 133, 244, 0.5);
    letter-spacing: 1px;
}

/* 标签切换样式 */
.tabs-container {
    display: flex;
    gap: 8px;
    padding: 0 5px;
    margin-top: -5px;
}

.tab-btn {
    flex: 1;
    padding: 10px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--on-surface-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tab-btn:hover {
    background: var(--surface-light);
    border-color: var(--primary);
    color: var(--on-surface);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-light);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
}

.tab-btn.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-light);
}

.search-container {
    display: flex;
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    margin: 0 5px;
}

/* Vue路由搜索框样式 */
.vue-route-search-container {
    display: flex;
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.vue-route-search-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.3);
}

#vue-route-search-input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background: transparent;
    color: var(--on-surface);
    font-size: 14px;
    outline: none;
}

#vue-route-search-input::placeholder {
    color: var(--on-surface-secondary);
}

#vue-route-search-btn {
    padding: 0 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--on-surface-secondary);
    transition: color 0.2s;
}

#vue-route-search-btn:hover {
    color: var(--primary);
}

.search-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.3);
}

#search-input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background: transparent;
    color: var(--on-surface);
    font-size: 14px;
    outline: none;
}

#search-input::placeholder {
    color: var(--on-surface-secondary);
}

#search-btn {
    padding: 0 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--on-surface-secondary);
    transition: color 0.2s;
}

#search-btn:hover {
    color: var(--primary);
}

/* 反调试板块：3列网格样式 */
.scripts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-height: 420px;
    overflow-y: auto;
    padding: 8px;
    margin-top: 5px;
}

.script-item {
    background: var(--surface);
    border-radius: 8px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: var(--card-height);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.script-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--primary);
    z-index: 5;
}

.script-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.script-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.script-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--on-surface);
    line-height: 1.3;
    flex: 1;
}

.script-description {
    color: var(--on-surface-secondary);
    font-size: 11px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
    margin-left: 6px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

input:checked + .slider:before {
    transform: translateX(16px);
}

/* Vue板块容器 */
.vue-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 420px;
    overflow-y: auto;
    padding: 8px;
}

/* Vue脚本列表 */
.vue-scripts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-x: visible;
}

.vue-script-item {
    background: var(--surface);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.vue-script-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 50;
}

.vue-script-item.active {
    border-color: var(--primary-light);
    background: linear-gradient(to right, var(--surface) 0%, rgba(26, 115, 232, 0.05) 100%);
}

/* 子脚本样式（外部连接线） */
.vue-script-item.child-script {
    margin-left: 40px;
    margin-top: -5px;
    background: rgba(17, 34, 64, 0.6);
    border-left: 3px solid var(--primary);
}

/* 横向连接线（从左侧延伸到框框） */
.vue-script-item.child-script::before {
    content: "";
    position: absolute;
    left: -25px;
    top: 50%;
    width: 25px;
    height: 2px;
    background: var(--primary);
}

/* 纵向连接线（从父脚本底部延伸下来） */
.vue-script-item.child-script::after {
    content: "";
    position: absolute;
    left: -25px;
    top: -5px;
    width: 2px;
    height: calc(50% + 5px);
    background: var(--primary);
}

.vue-script-name {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
    color: var(--on-surface);
}

.vue-script-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
}

.vue-script-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.vue-script-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: .3s;
    border-radius: 34px;
}

.vue-script-switch .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.vue-script-switch input:checked + .slider {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.vue-script-switch input:checked + .slider:before {
    transform: translateX(20px);
}

/* 叹号提示图标 */
.vue-script-info {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--surface-light);
    border: 1px solid var(--border);
    cursor: help;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.vue-script-info:hover {
    background: var(--primary);
    border-color: var(--primary-light);
    transform: scale(1.1);
}

.vue-script-info svg {
    width: 14px;
    height: 14px;
    color: var(--on-surface-secondary);
    transition: color 0.3s ease;
}

.vue-script-info:hover svg {
    color: #ffffff;
}

/* Tooltip 提示框 - 向下弹出 */
.vue-script-info .tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: calc(100% + 10px);
    right: -10px;
    background: var(--surface-light);
    color: var(--on-surface);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
    width: 280px;
    max-width: 280px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--primary);
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.vue-script-info .tooltip::before {
    content: "";
    position: absolute;
    bottom: 100%;
    right: 14px;
    border: 7px solid transparent;
    border-bottom-color: var(--primary);
}

.vue-script-info .tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    right: 15px;
    border: 6px solid transparent;
    border-bottom-color: var(--surface-light);
}

.vue-script-info:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* Vue Router 数据显示区 */
.vue-router-data {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 10px;
}

.vue-version-display {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.routes-info {
    color: var(--on-surface);
    font-size: 14px;
    font-weight: 600;
}

.routes-info .highlight {
    color: var(--primary-light);
    font-weight: 700;
}

.version-label {
    font-weight: 600;
    color: var(--on-surface);
    font-size: 13px;
}

.version-value {
    font-weight: 700;
    color: var(--primary-light);
    font-size: 15px;
}

/* 路由列表容器 */
.routes-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.routes-list-header {
    font-weight: 600;
    font-size: 14px;
    color: var(--on-surface);
    padding: 0 8px;
}

.route-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.route-item:hover {
    border-color: var(--primary);
    background: var(--surface-light);
}

.route-url {
    flex: 1;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 15px;
    font-weight: 500;
    color: var(--on-surface);
    word-break: break-all;
    white-space: normal;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.route-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.route-btn {
    padding: 6px 12px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--on-surface);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.route-btn:hover {
    background: var(--primary);
    border-color: var(--primary-light);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(26, 115, 232, 0.4);
}

.route-btn.copy-btn:hover {
    background: var(--success);
    border-color: var(--success);
}

/* 批量复制按钮容器 */
.routes-actions-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}

.footer-btn {
    padding: 8px 16px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--on-surface);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.footer-btn:hover {
    background: var(--primary);
    border-color: var(--primary-light);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(26, 115, 232, 0.4);
}

.footer-btn:active {
    transform: translateY(0);
}

/* 空状态提示 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--on-surface-secondary);
    font-size: 14px;
}

.no-results {
    display: none;
    text-align: center;
    padding: 20px 0;
    color: var(--on-surface-secondary);
    flex-direction: column;
    align-items: center;
    gap: 15px;
    grid-column: 1 / -1;
}

.no-results svg {
    width: 48px;
    height: 48px;
    color: var(--primary);
}

/* 底部区域优化 */
footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 5px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    margin: 10px 5px 0;
    position: relative;
    z-index: 2;
    background: transparent;
}

/* 提示信息 - 移到左侧 */
.hint {
    font-style: italic;
    background: transparent;
    text-align: left;
    padding: 5px 10px;
}

/* 署名信息 - 使用原计数样式 */
.signature {
    color: var(--primary-light);
    background: transparent;
    text-align: right;
    padding: 5px 10px;
    font-weight: bold;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* 活动脚本指示器 */
.script-item.active {
    position: relative;
}

.script-item.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 0 0 8px 8px;
}

.github-link {
    position: absolute;
    top: 13px;
    right: 15px;
    color: var(--on-surface);
    transition: color 0.3s;
    width: 24px;
    height: 24px;
    z-index: 20;
}

.github-link:hover {
    color: var(--primary-light);
    transform: scale(1.1);
}

/* ========== 多实例标签页样式 ========== */
.instance-tabs {
    margin-bottom: 12px;
}

.instance-tabs-header {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow-x: auto;
}

.instance-tab-btn {
    padding: 10px 16px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--on-surface-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 120px;
}

.instance-tab-btn:hover {
    background: var(--surface-light);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.instance-tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-light);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
}

.instance-tab-btn.active .instance-tab-subtitle {
    opacity: 0.9;
}

.instance-tab-title {
    font-size: 14px;
    font-weight: 700;
}

.instance-tab-subtitle {
    font-size: 11px;
    opacity: 0.7;
    font-weight: 500;
}

/* 标签页滚动条 */
.instance-tabs-header::-webkit-scrollbar {
    height: 6px;
}

.instance-tabs-header::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}

.instance-tabs-header::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.instance-tabs-header::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* ========== Base路径输入框样式 ========== */
.route-base-input-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detected-base-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detected-base-label {
    font-weight: 600;
    color: var(--on-surface);
    font-size: 13px;
}

.detected-base-value {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-light);
    background: rgba(26, 115, 232, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    flex: 1;
}

.apply-detected-base-btn {
    padding: 6px 14px;
    background: var(--primary);
    border: 1px solid var(--primary-light);
    border-radius: 6px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apply-detected-base-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(26, 115, 232, 0.4);
}

.custom-base-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-base-label {
    font-weight: 600;
    color: var(--on-surface);
    font-size: 13px;
    white-space: nowrap;
}

.custom-base-input {
    flex: 1;
    padding: 8px 12px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--on-surface);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
}

.custom-base-input::placeholder {
    color: var(--on-surface-secondary);
    opacity: 0.6;
}

.custom-base-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.3);
}

.clear-base-btn {
    padding: 6px 14px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--on-surface-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-base-btn:hover {
    background: var(--error);
    border-color: var(--error);
    color: #ffffff;
}

.base-hint {
    font-size: 12px;
    color: var(--on-surface-secondary);
    font-style: italic;
    padding-left: 4px;
}