/* 通用基础样式 */

/* Reset: 清除浏览器默认内边距和外边距 */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 全局字体和背景 */
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #333;
  background-color: #fff;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 文字和链接 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-bottom: 0.5em;
  color: #222;
}

p {
  margin-bottom: 1em;
}

a {
  color: #007bff;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease-in-out;
}
a:hover,
a:focus {
  color: #0056b3;
  text-decoration: underline;
}

/* 列表 */
ul, ol {
  margin-left: 1.5em;
  margin-bottom: 1em;
}

li {
  margin-bottom: 0.5em;
}

/* 按钮 */
button,
input[type="submit"],
input[type="button"] {
  background-color: #007bff;
  border: none;
  color: white;
  padding: 0.5em 1em;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background-color: #0056b3;
}

/* 表单元素 */
input[type="text"],
input[type="password"],
input[type="search"],
select,
textarea {
  font-size: 1rem;
  padding: 0.4em 0.6em;
  border: 1px solid #ccc;
  border-radius: 4px;
  outline-offset: 2px;
  outline-color: transparent;
  transition: outline-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
  width: 100%;
  max-width: 300px;
  box-sizing: border-box;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: #007bff;
  outline-color: #007bff;
}

/* 图片 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 布局辅助 */
.container {
  width: 90%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 1em 0;
}

/* Flex 布局通用类 */
.flex {
  display: flex;
}

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

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

/* 常用间距辅助 */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.p-1  { padding: 0.25rem; }
.p-2  { padding: 0.5rem; }
.p-3  { padding: 1rem; }

/* 表格基础样式 */
table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1em;
}

th,
td {
  border: 1px solid #ddd;
  padding: 0.5em 1em;
  text-align: left;
}

th {
  background-color: #f5f5f5;
  font-weight: 600;
}

/* 响应式 */
@media (max-width: 600px) {
  body {
    font-size: 14px;
  }

  .container {
    width: 95%;
  }
}
