:root { --tab-font-family: -apple-system, 'Segoe UI', roboto, oxygen-sans, ubuntu, cantarell, 'Helvetica Neue', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; --tab-font-size: 12px; --tab-transition: background-color 200ms ease-out, color 200ms ease-out; --tab-cursor: pointer; --tab-color: #7f8792; --tab-background: #EFF0F4; --tab-active-color: #222529; --tab-active-background: #FFFFFF; --tab-close-color: #9DA3AC; } * { margin: 0; padding: 0; } html, body { margin: 0; padding: 0; font-family: 'Roboto', sans-serif; font-size: 16px; color: #333; } .app { display: flex; align-items: center; } .nav { font-family: var(--tab-font-family); font-feature-settings: 'clig', 'kern'; flex: 1; width: 0; display: flex; cursor: default; background-color: var(--tab-background); -webkit-app-region: drag; } /* 导航按钮 */ .nav-controls { display: flex; align-items: center; margin-right: 12px; -webkit-app-region: none; } .nav-controls div { display: flex; justify-content: center; align-items: center; width: 32px; height: 32px; cursor: pointer; } .nav-controls svg { width: 16px; height: 16px; color: var(--tab-active-color); } .nav-controls .disabled { cursor: not-allowed !important; } .nav-controls .disabled svg { opacity: 0.3; } /* 标签 */ .nav-tabs { min-width: 0; flex: 1; display: flex; gap: 8px; height: 35px; margin-top: 5px; user-select: none; overflow-x: auto; overflow-y: hidden; } .nav-tabs::-webkit-scrollbar { display: none; } .nav-tabs li { display: inline-flex; position: relative; box-sizing: border-box; align-items: center; height: calc(100% - 5px); padding: 7px 8px; min-width: 100px; max-width: 240px; scroll-margin: 12px; font-size: var(--tab-font-size); color: var(--tab-color); cursor: var(--tab-cursor); transition: var(--tab-transition); -webkit-app-region: none; } .nav-tabs li:first-child { border-left: none; } .nav-tabs li.active { color: var(--tab-active-color); background: var(--tab-active-background); border-radius: 4px; } .nav-tabs li.active .tab-icon.background { background-image: url(../image/link_normal_selected_icon.png); } .nav-tabs li:not(.active)::after { position: absolute; right: 0; width: 1px; height: 16px; background: rgba(0, 0, 0, 0.08); content: ''; } .nav-tabs li:not(.active):last-child::after { content: none; } /* 浏览器打开 */ .nav-browser { flex-shrink: 0; display: flex; align-items: center; height: 40px; padding: 0 14px; margin: 0 2px; cursor: pointer; background-color: var(--tab-background); -webkit-app-region: none; } .nav-browser span { display: inline-block; width: 18px; height: 18px; background-size: cover; background-image: url(../image/link_normal_selected_icon.png); } /* 图标 */ .tab-icon { display: inline-block; flex-shrink: 0; width: 16px; height: 16px; background-size: cover; } .tab-icon.background { background-image: url(../image/link_normal_icon.png); } .tab-icon.loading { background-image: none !important; } .tab-icon .tab-icon-loading { width: 18px; height: 18px; border: 2px solid #eeeeee; border-bottom-color: #84C56A; border-radius: 50%; display: inline-block; box-sizing: border-box; animation: spin 0.75s linear infinite; } .tab-icon:not(.loading) .tab-icon-loading { display: none; } .tab-icon img { width: 16px; height: 16px; border-radius: 4px; } @keyframes spin { 0% { transform: scale(0.8) rotate(0deg); } 100% { transform: scale(0.8) rotate(360deg); } } /* 标题 */ .tab-title { display: inline-block; flex: 1; margin: 0 8px; overflow: hidden; line-height: 150%; text-overflow: ellipsis; white-space: nowrap; } /* 关闭 */ .tab-close { display: inline-block; width: 14px; height: 14px; margin-right: 2px; position: relative; } .tab-close::after, .tab-close::before { position: absolute; top: 50%; right: 50%; transform: translate(50%, -50%) scale(0.9) rotate(45deg); content: ""; width: 2px; height: 11px; border-radius: 3px; background-color: var(--tab-close-color); } .tab-close::before { transform: translate(50%, -50%) scale(0.9) rotate(-45deg); } /* 不同平台样式 */ body.win32 .nav { padding-left: 8px; padding-right: 140px; } body.darwin .nav { padding-left: 76px; } body.darwin.full-screen .nav { padding-left: 8px; } /* 暗黑模式 */ @media (prefers-color-scheme: dark) { :root { --tab-color: #C5C5C5; --tab-background: #3B3B3D; --tab-active-color: #E1E1E1; --tab-active-background: #575757; --tab-close-color: #E3E3E3; } .nav-tabs li.active .tab-icon.background { background-image: url(../image/dark/link_normal_selected_icon.png); } .nav-browser span { background-image: url(../image/dark/link_normal_selected_icon.png); } .tab-icon.background { background-image: url(../image/dark/link_normal_icon.png); } }