/* 统一输入框、文本域和下拉框的样式 */
input[type="text"], input[type="password"], textarea, select {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box; /* 确保 padding 不会影响宽度 */
}

/* 强制统一高度，特别是 textarea 和 select */
input[type="text"], select, textarea {
    height: 40px; /* 固定统一高度 */
    padding: 10px; /* 确保输入框和下拉框的内边距一致 */
}

/* 调整 textarea 的默认行为 */
textarea {
    resize: vertical; /* 允许垂直调整大小 */
    height: 40px; /* 固定初始高度，防止页面布局跳动 */
    min-height: 40px; /* 保持最小高度一致 */
}

/* 按钮样式 */
button {
    padding: 10px 20px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px; /* 按钮与其他元素保持间距 */
}

button:hover {
    background-color: #004a99;
}

/* 按钮样式 */
.add-button, .logout-button {
    background-color: green;
    color: white;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 5px;
    margin-right: 10px;
    font-size: 16px;
}

.add-button:hover, .logout-button:hover {
    background-color: darkgreen;
}

/* 使表单字段在大屏幕上也保持一致宽度 */
form {
    max-width: 600px;
    margin: 0 auto;
}

/* API 列表布局 */
.api-list {
    display: flex;
    flex-direction: column;
    gap: 10px; /* 增加项目之间的间距 */
    margin-top: 20px;
    text-align: center;
    align-items: center; /* 使列表在容器中水平居中 */
    max-width: 1000px; /* 设置最大宽度为1000px */
    margin: 10px auto; /* 水平居中 */
    padding: 10px 20px; /* 与.statistics的内边距保持一致 */
}

.api-item {
    background: rgba(255, 255, 255, 0.9); /* 半透明背景 */
    border: 1px solid rgba(0, 0, 0, 0.1); /* 轻微的边框 */
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3); /* 更强的阴影 */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: left;
    width: 100%; /* 让.api-item占据父元素的全部宽度 */
    margin: 0; /* 移除自动居中 */
    color: #333;
    text-decoration: none;
    outline: none;
}

/* 悬停效果 */
.api-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* 去掉 active 和 focus 样式 */
.api-item:active,
.api-item:focus {
    color: #333;
    outline: none;
    text-decoration: none;
}

.api-item h2 {
    margin-top: 0;
}

.api-item p {
    margin: 3px 0; /* 减少段落间距 */
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.header {
    animation: fadeIn 1s ease-in-out;
}

.search-form input[type="text"] {
    animation: fadeIn 1s ease-in-out 0.5s; /* 搜索框延迟淡入 */
}