
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #cbd5e1;
  --radius: 12px;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100% !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important; /* 核心：让所有子节点（标题、卡片、页脚）在页面水平绝对居中 */
  justify-content: flex-start !important;
  padding: 2.5rem 1rem !important;
}

/* 页面大标题 */
h1 {
  text-align: center !important;
  margin-top: 1rem !important;
  margin-bottom: 2rem !important;
  width: 100% !important;
}

h1 a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 800;
  font-size: 2.2rem;
  letter-spacing: -0.025em;
}

/* 主卡片容器 */
#container {
  max-width: 620px !important;
  width: 100% !important;
  margin: 0 auto !important;
  background: var(--card-bg) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 2rem !important;
  border: 1px solid #e2e8f0 !important;
}

/* 消除内部 fieldset 和 form 的重复边框与多余 margin */
fieldset, form {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* 表单结构转为 Flex 容器 */
form {
  display: flex !important;
  flex-direction: column !important;
}

/* 彻底清理 Jirafeau 内部表格样式，改为网格对齐 */
table, tbody {
  width: 100% !important;
  display: block !important;
  border-collapse: collapse !important;
}

tr {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 1.25rem !important;
  width: 100% !important;
}

td {
  display: flex !important;
  align-items: center !important;
  padding: 0 !important;
}

/* 左侧 Label 列对齐 */
td:first-child, td.label, tr td:first-child {
  width: 200px !important;          /* 调大左侧标签宽度 */
  min-width: 200px !important;      /* 保证不挤压文字 */
  white-space: nowrap !important;   /* 强制禁止文字换行 */
  font-weight: 600 !important;
  color: var(--text-main) !important;
  font-size: 0.95rem !important;
  text-align: left !important;
  justify-content: flex-start !important;
}

/* 右侧 Control 控件列对齐 */
td:last-child, tr td:last-child {
  flex: 1 !important;
  justify-content: flex-end !important;
}

/* 统一输入框与下拉菜单样式与宽度 */
input[type=text], input[type=password], select {
  height: 42px !important;
  width: 260px !important; /* 统一设置固定宽度，解决左右对齐问题 */
  padding: 0 0.8rem !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  font-size: 0.95rem !important;
  background: #ffffff !important;
  outline: none !important;
  transition: border-color 0.2s ease !important;
  box-sizing: border-box !important;
}

input[type=text]:focus, input[type=password]:focus, select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* 密码框与显示密码按钮组合 */
.passwordcolumn, td.passwordcolumn {
  display: flex !important;
  width: 260px !important;
  justify-content: flex-end !important;
}

.passwordcolumn input {
  width: 218px !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.passwordcolumn button, #show_password_btn, .show_password {
  width: 42px !important;
  height: 42px !important;
  border: 1px solid var(--border) !important;
  border-left: none !important;
  border-top-right-radius: 8px !important;
  border-bottom-right-radius: 8px !important;
  background: #f8fafc !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* 复选框勾选框调整 */
input[type=checkbox] {
  width: 20px !important;
  height: 20px !important;
  cursor: pointer !important;
  accent-color: var(--primary) !important;
  margin-right: 0 !important;
}

/* 文件上传区域 */
input[type=file] {
  width: 100% !important;
  padding: 1.5rem 1rem !important;
  border: 2px dashed #cbd5e1 !important;
  border-radius: var(--radius) !important;
  background: #f8fafc !important;
  cursor: pointer !important;
  margin-bottom: 0.5rem !important;
}

/* 提示文本（文件大小限制） */
p, .max_file_size, #max_file_size {
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
  margin-bottom: 1.5rem !important;
  text-align: left !important;
  position: static !important;
}

/* 强行将发送按钮排在最底下 */
input[type=submit], button[type=submit], #upload_btn, .btn-submit {
  order: 99 !important;
  width: 100% !important;
  height: 46px !important;
  background-color: var(--primary) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  border-radius: 8px !important;
  border: none !important;
  cursor: pointer !important;
  margin-top: 1rem !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2) !important;
  transition: background-color 0.2s ease !important;
}

input[type=submit]:hover, button[type=submit]:hover, #upload_btn:hover {
  background-color: var(--primary-hover) !important;
}

/* 底部版权及页脚区域布局调整 */
#copyright, .footer, div#copyright {
  width: 100% !important;
  max-width: 620px !important;
  text-align: center !important;
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
  margin: 2rem auto 0 auto !important;
  padding: 1rem 0 !important;
  display: block !important;
  box-sizing: border-box !important;
}

#copyright a, .footer a {
  color: var(--primary) !important;
  text-decoration: none !important;
}