:root {
    --success-color: #34c759;
    --error-color: #ff3b30;
    --warning-color: #ffcc00;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f7;
    color: #1d1d1f;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-weight: 500;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.update-time {
    color: #86868b;
    font-size: 0.9rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    opacity: 0;  /* 初始设置为不可见 */
    animation: fadeInUp 0.6s ease forwards;  /* 使用动画 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.service-header h2 {
    margin: 0;
    font-weight: 500;
    font-size: 1.2rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.status-indicator.active {
    background-color: var(--success-color);
}

.status-indicator.error {
    background-color: var(--error-color);
}

.status-indicator.warning {
    background-color: var(--warning-color);
}

.response-time {
    color: #86868b;
    font-size: 0.9rem;
    margin: 0;
}

.details {
    color: #86868b;
    font-size: 0.9rem;
    margin: 5px 0;
}

.ports-list {
    margin-top: 10px;
    max-height: 200px;  /* 设置最大高度 */
    overflow-y: auto;   /* 添加垂直滚动条 */
    scrollbar-width: thin;  /* Firefox 滚动条样式 */
    scrollbar-color: #86868b #f5f5f7;  /* Firefox 滚动条颜色 */
}

/* Webkit (Chrome/Safari) 滚动条样式 */
.ports-list::-webkit-scrollbar {
    width: 6px;
}

.ports-list::-webkit-scrollbar-track {
    background: #f5f5f7;
    border-radius: 3px;
}

.ports-list::-webkit-scrollbar-thumb {
    background-color: #86868b;
    border-radius: 3px;
}

.ports-list::-webkit-scrollbar-thumb:hover {
    background-color: #666;
}

.port-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.port-item:last-child {
    border-bottom: none;
}

.port-name {
    font-size: 0.9rem;
    color: #1d1d1f;
}

.port-status {
    font-size: 0.85rem;
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.port-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.port-status.open {
    color: var(--success-color);
    background-color: rgba(52, 199, 89, 0.1);
}

.port-status.open::before {
    background-color: var(--success-color);
}

.port-status.closed {
    color: var(--error-color);
    background-color: rgba(255, 59, 48, 0.1);
}

.port-status.closed::before {
    background-color: var(--error-color);
}

.port-details {
    font-size: 0.85rem;
    color: #86868b;
    font-family: monospace;
}

.api-card {
    grid-column: 1 / -1;  /* API卡片占据整行 */
}

.api-list {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.api-item {
    background: #f5f5f7;
    border-radius: 8px;
    padding: 12px;
}

.api-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.api-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.api-method {
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e1e1e6;
}

.api-method.get { color: #34c759; }
.api-method.post { color: #007aff; }
.api-method.put { color: #ff9500; }
.api-method.delete { color: #ff3b30; }

.api-details {
    font-size: 0.85rem;
    color: #86868b;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.api-status-text {
    font-size: 0.85rem;
    padding: 2px 8px;
    border-radius: 10px;
    background-color: #f5f5f7;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.api-status-text::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.api-status-text.success {
    color: var(--success-color);
}

.api-status-text.success::before {
    background-color: var(--success-color);
}

.api-status-text.warning {
    color: var(--warning-color);
}

.api-status-text.warning::before {
    background-color: var(--warning-color);
}

.api-status-text.error {
    color: var(--error-color);
}

.api-status-text.error::before {
    background-color: var(--error-color);
}

.api-status-text.slow {
    color: #ff9500;
}

.api-status-text.slow::before {
    background-color: #ff9500;
}

.status-tooltip {
    position: relative;
    cursor: help;
}

.status-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background-color: rgba(0,0,0,0.8);
    color: white;
    font-size: 0.8rem;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
}

.footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: #86868b;
    font-size: 0.9rem;
}

.footer p {
    margin: 0;
}

/* 为每个卡片设置不同的延迟，实现依次显示效果 */
.services-grid .service-card:nth-child(1) {
    animation-delay: 0.1s;
}

.services-grid .service-card:nth-child(2) {
    animation-delay: 0.2s;
}

.services-grid .service-card:nth-child(3) {
    animation-delay: 0.3s;
}

.services-grid .service-card:nth-child(4) {
    animation-delay: 0.4s;
}

.services-grid .service-card:nth-child(5) {
    animation-delay: 0.5s;
}

/* 添加深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1c1c1e;
        --text-color: #ffffff;
        --card-bg: #2c2c2e;
    }

    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }

    .service-card {
        background: var(--card-bg);
    }
}

/* 添加打印样式 */
@media print {
    .service-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
} 