* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f5f7fa;
    color: #1e293b;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 280px;
    background: #ffffff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.logo {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.logo i {
    font-size: 28px;
    color: #2563eb;
}

.logo h2 {
    font-size: 18px;
    font-weight: 600;
}

.nav-menu {
    flex: 1;
    padding: 24px 0;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-menu a:hover {
    background: #f8fafc;
    color: #2563eb;
}

.nav-menu a.active {
    background: #eff6ff;
    color: #2563eb;
    border-left-color: #2563eb;
}

.nav-menu a i {
    width: 20px;
    font-size: 16px;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid #e2e8f0;
}

.current-backend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
}

.current-backend i {
    font-size: 10px;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 32px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.page-header p {
    color: #64748b;
}

/* 转换器样式 */
.converter-box {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.url-input-wrapper {
    display: flex;
    gap: 12px;
}

.url-input-wrapper input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.url-input-wrapper input:focus {
    outline: none;
    border-color: #2563eb;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.platform-detection {
    margin: 20px 0;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.detection-label {
    color: #64748b;
    margin-right: 12px;
}

.platform-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #e2e8f0;
    border-radius: 20px;
    font-size: 14px;
}

.result-group {
    margin: 20px 0;
}

.result-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.result-wrapper input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    font-family: monospace;
}

.result-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 44px;
    height: 44px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.quick-actions h3 {
    margin: 24px 0 16px;
    font-size: 16px;
    color: #64748b;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.quick-link-item {
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-link-item:hover {
    background: #2563eb;
    color: white;
}

/* 后端管理样式 */
.backend-config {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.add-backend {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e2e8f0;
}

.add-backend h3 {
    margin-bottom: 16px;
}

.add-backend-form {
    display: flex;
    gap: 12px;
}

.add-backend-form input,
.add-backend-form select {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.add-backend-form input {
    flex: 2;
}

.add-backend-form select {
    flex: 1;
}

.backend-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.backend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.backend-item:hover {
    border-color: #2563eb;
}

.backend-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.backend-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.backend-status.online {
    background: #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.backend-status.offline {
    background: #f44336;
}

.backend-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.backend-url {
    font-weight: 500;
}

.backend-meta {
    font-size: 12px;
    color: #64748b;
    display: flex;
    gap: 16px;
}

.backend-actions {
    display: flex;
    gap: 8px;
}

.backend-actions button {
    padding: 8px;
    border: none;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.backend-actions button:hover {
    background: #e2e8f0;
}

/* 源列表样式 */
.source-filters {
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
}

.source-filters input,
.source-filters select {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.source-filters input {
    flex: 2;
}

.source-filters select {
    flex: 1;
}

.source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.source-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.source-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-color: #2563eb;
}

.source-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.source-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    border-radius: 8px;
    color: #2563eb;
}

.source-name {
    font-weight: 600;
}

.source-category {
    font-size: 12px;
    color: #2563eb;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 8px;
}

.source-prefix {
    font-family: monospace;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 8px;
}

.source-example {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-actions {
    display: flex;
    gap: 8px;
}

.source-actions button {
    flex: 1;
    padding: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.source-actions button:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* 设置表单样式 */
.settings-form {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.setting-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.setting-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.setting-item select {
    margin-top: 8px;
    padding: 8px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    width: 100%;
    max-width: 300px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .url-input-wrapper {
        flex-direction: column;
    }

    .add-backend-form {
        flex-direction: column;
    }

    .source-grid {
        grid-template-columns: 1fr;
    }
}

/* 加载动画 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* 提示信息 */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 24px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    animation: slideIn 0.3s;
}

.toast.success {
    border-left: 4px solid #4caf50;
}

.toast.error {
    border-left: 4px solid #f44336;
}

.toast.info {
    border-left: 4px solid #2196f3;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}