/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    display: flex;
}

/* 侧边栏 */
.sidebar {
    width: 200px;
    background: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: width 0.3s;
}

.sidebar-header {
    padding: 16px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.header-icon {
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: #3498db;
    color: white;
}

.nav-icon {
    font-size: 16px;
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.nav-text {
    font-size: 13px;
}

.sidebar-footer {
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
}

.user-avatar {
    font-size: 16px;
}

.user-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

/* 主内容包装器 */
.main-wrapper {
    margin-left: 200px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s;
}

/* 顶部栏 */
.topbar {
    background: white;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.topbar-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 内容区 */
.content {
    flex: 1;
    padding: 24px;
}

.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

.content-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f9ff;
    border-radius: 8px;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

/* 表格容器 */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    padding: 20px;
}

/* 配置列表 */
.config-list {
    max-height: calc(100vh - 400px);
    overflow-y: auto;
}

/* 表单 */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.form-group .required {
    color: #ef4444;
    margin-left: 2px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="file"] {
    padding: 10px 16px;
    cursor: pointer;
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

.input-group {
    display: flex;
    gap: 12px;
}

.input-group input {
    flex: 1;
}

.input-group select {
    width: 120px;
}

/* 按钮 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: #6b7280;
    color: white;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2);
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-group .btn {
    flex: 1;
}

/* 自动模式状态 */
.auto-status {
    background: #f9fafb;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.auto-status span {
    display: block;
    color: #666;
}

.auto-status span:first-child {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

/* 日志容器 */
.log-container {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 6px;
    height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.log-container::-webkit-scrollbar {
    width: 8px;
}

.log-container::-webkit-scrollbar-track {
    background: #0f172a;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.log-entry {
    margin-bottom: 8px;
    padding: 4px 0;
}

.log-time {
    color: #94a3b8;
    margin-right: 8px;
}

.log-info { color: #60a5fa; }
.log-success { color: #34d399; }
.log-error { color: #f87171; }
.log-warning { color: #fbbf24; }

.log-empty {
    text-align: center;
    color: #64748b;
    padding: 40px 0;
}

/* APP 列表 */
.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.app-list {
    max-height: 400px;
    overflow-y: auto;
}

.app-item {
    background: #f9fafb;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    transition: all 0.3s;
}

.app-item:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.app-name {
    font-weight: 500;
    color: #333;
    font-size: 15px;
}

.app-time {
    font-size: 12px;
    color: #999;
}

.app-info {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #666;
}

.app-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.app-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
}

.loading {
    text-align: center;
    padding: 40px 0;
    color: #999;
}

/* 系统信息 */
.system-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
}

.info-label {
    color: #666;
    font-size: 14px;
}

.info-value {
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

/* 进度弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

/* 进度弹窗样式 */
.modal-progress {
    max-width: 500px;
    text-align: center;
    padding: 40px 30px;
}

.progress-header {
    margin-bottom: 30px;
}

.progress-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 6px solid #f3f4f6;
    border-top: 6px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-title {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.progress-bar-container {
    position: relative;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-percentage {
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

.progress-text {
    text-align: center;
    color: #6b7280;
    font-size: 16px;
    margin-bottom: 20px;
    font-weight: 500;
    min-height: 24px;
}

.progress-tips {
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 20px;
}

.progress-tips p {
    margin: 0;
    color: #1e40af;
    font-size: 14px;
    line-height: 1.6;
}

.progress-log {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    display: none; /* 默认隐藏日志 */
}

/* 配置列表 */
.config-list {
    min-height: 500px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

/* APP统计 */
.app-stats {
    display: flex;
    gap: 20px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
}

.config-item {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s;
    border-left: 4px solid #667eea;
    position: relative;
    z-index: 1;
}

.config-item:hover {
    background: #f3f4f6;
    transform: translateX(4px);
    z-index: 1;
}

.config-item.auto-running {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.config-item.auto-stopped {
    border-left-color: #ef4444;
}

.config-item.manual {
    border-left-color: #9ca3af;
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.config-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.config-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.config-badge.running {
    background: #d1fae5;
    color: #065f46;
}

.config-badge.stopped {
    background: #fee2e2;
    color: #991b1b;
}

.config-badge.manual {
    background: #e5e7eb;
    color: #374151;
}

.config-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #666;
}

.config-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.config-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.config-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
    flex: 0 0 auto;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    padding: 6px 12px;
    font-size: 12px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.dropdown-toggle:hover {
    background: #4b5563;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 2000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

.dropdown-item:first-child {
    border-radius: 6px 6px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 6px 6px;
}

.dropdown-item.danger {
    color: #ef4444;
}

.dropdown-item.danger:hover {
    background: #fee2e2;
}

/* 开关按钮 */
.switch-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 模态框 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 36px 20px 36px;
    border-bottom: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: white;
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 20px;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px 36px 36px 36px;
}

/* 为模态框内的表单和内容添加padding */
.modal-content > form,
.modal-content > .tab-nav,
.modal-content > .tab-content {
    padding-left: 36px;
    padding-right: 36px;
}

.modal-content > form {
    padding-bottom: 36px;
}

.modal-content > .tab-nav {
    padding-top: 20px;
}

.modal-content > .tab-content {
    padding-bottom: 36px;
}

.modal-large {
    max-width: 750px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* 标签页 */
.tab-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    border-bottom: none;
    background: #f8f9fa;
    padding: 6px;
    border-radius: 10px;
}

.tab-btn {
    padding: 12px 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    border-radius: 8px;
    transition: all 0.3s;
    position: relative;
}

.tab-btn:hover {
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 复选框组 */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 14px 16px;
    border-radius: 8px;
    transition: all 0.3s;
    background: white;
    border: 2px solid #e5e7eb;
}

.checkbox-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    transform: translateX(4px);
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;
}

.checkbox-item span {
    font-size: 14px;
    color: #374151;
    user-select: none;
    line-height: 1.4;
}

.checkbox-item input[type="checkbox"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.checkbox-item:has(input[type="checkbox"]:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

/* 单选框组 */
.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 14px 16px;
    border-radius: 8px;
    transition: all 0.3s;
    background: white;
    border: 2px solid #e5e7eb;
    position: relative;
}

.radio-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.radio-item input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;
}

.radio-item input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.radio-item span {
    font-size: 14px;
    color: #374151;
    user-select: none;
    line-height: 1.4;
}

.radio-item input[type="radio"]:checked ~ * {
    color: #667eea;
}

.radio-item:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.error-hint {
    margin-top: 8px;
    font-size: 13px;
    display: block;
}

/* 响应式 */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-240px);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 0 16px;
    }
    
    .page-title {
        font-size: 16px;
    }
    
    .content {
        padding: 16px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .config-info {
        grid-template-columns: 1fr;
    }
}


/* 工具状态列表 */
.tool-status-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tool-status-item {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s;
}

.tool-status-item.installed {
    border-color: #10b981;
    background: #f0fdf4;
}

.tool-status-item.not-installed {
    border-color: #ef4444;
    background: #fef2f2;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tool-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.tool-status {
    font-size: 14px;
    color: #666;
}

.tool-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.tool-command {
    font-size: 13px;
    color: #999;
}

.tool-command code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #333;
}


/* Toggle Switch 样式 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin: 0 8px;
    vertical-align: middle;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #3498db;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toggle Switch 容器 */
.toggle-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.toggle-label {
    font-size: 13px;
    color: #666;
    user-select: none;
}

.toggle-label.active {
    color: #3498db;
    font-weight: 500;
}


/* 侧边栏收缩按钮 - 放在底部 */
.sidebar-toggle-btn {
    width: 100%;
    padding: 6px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 14px;
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.toggle-icon-expand,
.toggle-icon-collapse {
    flex-shrink: 0;
    transition: opacity 0.3s;
}

.toggle-icon-collapse {
    display: none;
}

.toggle-text {
    white-space: nowrap;
    transition: opacity 0.3s;
    display: none;
}

/* 侧边栏收缩状态 */
.sidebar.collapsed {
    width: 50px;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .user-name {
    opacity: 0;
    visibility: hidden;
    width: 0;
}

.sidebar.collapsed .sidebar-header h2 span {
    display: none;
}

.sidebar.collapsed .header-icon {
    opacity: 1;
    visibility: visible;
}

.sidebar.collapsed .sidebar-header {
    padding: 16px 5px;
    text-align: center;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px 5px;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
}

.sidebar.collapsed .user-info {
    justify-content: center;
    padding: 8px 5px;
}

.sidebar.collapsed .user-avatar {
    margin-right: 0;
}

.sidebar.collapsed .sidebar-toggle-btn {
    justify-content: center;
    padding: 6px 5px;
}

.sidebar.collapsed .toggle-icon-expand {
    display: none;
}

.sidebar.collapsed .toggle-icon-collapse {
    display: block;
}

/* 主内容区适配收缩状态 */
.main-wrapper {
    margin-left: 240px;
    transition: margin-left 0.3s;
}

.sidebar.collapsed ~ .main-wrapper {
    margin-left: 50px;
}

/* 导航图标样式优化 */
.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.nav-icon svg {
    stroke-width: 2;
    transition: all 0.3s;
}

.nav-item:hover .nav-icon svg {
    stroke-width: 2.5;
}

.nav-item.active .nav-icon svg {
    stroke: #3b82f6;
}

