/* 1. 标签选择器：直接控制 h1 标签 */
h1 {
    color: #d32f2f; /* 文字颜色：钢铁侠红 */
    font-family: sans-serif; /* 字体：无衬线字体 */
    text-align: center; /* 文字居中 */
}

/* 2. 类选择器（以点号 . 开头）：控制所有带有 card 类的元素 */
.card {
    background-color: #f5f5f5; /* 背景色：浅灰色 */
    border: 2px solid #ccc; /* 边框：2像素，实线，灰色 */
    padding: 20px; /* 内边距：盒子里的内容离边框的距离 */
    margin: 20px auto; /* 外边距：盒子离别人多远，auto代表水平居中 */
    width: 80%; /* 宽度占屏幕的 80% */
    border-radius: 10px; /* 圆角，战甲必备 */
}

/* 3. 按钮专属样式 */
button {
    background-color: #1976d2; /* 科技蓝 */
    color: white; /* 按钮文字变白 */
    border: none; /* 去掉默认丑陋的边框 */
    padding: 10px 20px; /* 上下10px，左右20px */
    border-radius: 5px; /* 按钮圆角 */
    cursor: pointer; /* 鼠标移上去变成小手 */
}

/* 4. 鼠标悬停在按钮上时的特效 */
button:hover {
    background-color: #1565c0; /* 鼠标移上去颜色变深 */
}
/* 1. Flex 布局：让输入框和按钮完美并排 */
.input-group {
    display: flex;       /* 开启弹性盒子模式 */
    gap: 10px;           /* 元素之间的间距 */
    justify-content: center; /* 整体水平居中 */
}

/* 让输入框自动占据剩余空间，不被按钮挤扁 */
.input-group input {
    flex: 1;             /* 自动伸展 */
    padding: 10px;       /* 输入框内边距 */
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* 2. 媒体查询：手机适配 */
/* 当屏幕宽度小于 600px（比如手机）时，执行下面的大括号 */
@media (max-width: 600px) {
    .card {
        width: 95%;      /* 手机屏幕上，卡片宽度占 95% */
        padding: 10px;   /* 减小内边距，节省空间 */
    }
    
    .input-group {
        flex-direction: column; /* 把原本左右并排的元素，变成上下排列 */
    }
}