/**
 * API中转系统 - 极简样式
 * 简洁、现代、响应式设计
 */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 容器布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 登录页面 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-block {
    width: 100%;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.card-header {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.table th {
    font-weight: 600;
    color: #555;
    background: #f8f9fa;
}

.table-striped tbody tr:nth-child(odd) {
    background: #f8f9fa;
}

/* 左侧菜单样式 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid #e0e0e0;
    padding: 1rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
}

.left-menu {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.menu-header {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 1rem;
}

.menu-header h3 {
    color: #333;
    font-size: 1.1rem;
}

.menu-items {
    flex: 1;
    overflow-y: auto;
}

.menu-item {
    margin-bottom: 0.5rem;
}

.menu-item-header {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #555;
    transition: all 0.3s;
}

.menu-item-header:hover {
    background: #f8f9fa;
    color: #667eea;
}

.menu-item.active .menu-item-header {
    background: #667eea;
    color: white;
    border-radius: 6px;
}

.menu-icon {
    font-size: 1.2rem;
}

.menu-title {
    flex: 1;
}

.menu-arrow {
    transition: transform 0.3s;
}

.menu-item.active .menu-arrow {
    transform: rotate(90deg);
}

.submenu {
    padding-left: 2rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.menu-item.active .submenu {
    max-height: 500px;
}

.submenu-item {
    display: block;
    padding: 0.5rem 1rem;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
}

.submenu-item:hover {
    color: #667eea;
    background: #f8f9fa;
    border-radius: 6px;
}

.submenu-item.active {
    color: #667eea;
    font-weight: 500;
}

.submenu-dot {
    margin-right: 0.5rem;
    color: #667eea;
}

.menu-footer {
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
    margin-top: 1rem;
}

.system-info {
    margin-bottom: 1rem;
}

.system-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.logout-btn {
    display: block;
    width: 100%;
    padding: 0.5rem;
    background: #f8f9fa;
    color: #666;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #e74c3c;
    color: white;
}

/* 状态卡片 */
.status-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.status-card h4 {
    margin-bottom: 1rem;
    color: #333;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.status-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.status-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.status-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

/* 警告和提示 */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        margin-bottom: 1rem;
    }
    
    .content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .status-grid {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 进度条 */
.progress {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s;
}

/* 代码显示 */
.code-block {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-link {
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.page-link:hover {
    background: #f8f9fa;
}

.page-link.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 安装向导特定样式 */
.install-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.install-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
}

.step {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: bold;
}

.step.active .step-number {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.step.completed .step-number {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.step-label {
    font-size: 0.9rem;
    color: #666;
}

.step.active .step-label {
    color: #667eea;
    font-weight: 500;
}