/* 定义一些全局的颜色变量，方便统一修改和管理 */
:root {
    --primary-color: #3B82F6;
    --secondary-color: #E0F2FE;
    --accent-color: #6a5acd;
    --button-gradient-start: #a6c1ee;
    --button-gradient-end: #fbc2eb;
    --circle-bg-color: #d0e0ff;
    --circle-shadow-color: rgba(106, 90, 205, 0.3);
    --hermes-orange: #F7941D;
    --light-yellow: #FFFFCC;
    --dark-orange: #FF8C00;
    --vermillion-red: #FF4500;
}
 html {
        font-size: 16px;
    }
/* 全局 body 样式，设置字体、背景渐变、并居中显示内容 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(to bottom right, var(--primary-color), var(--secondary-color));
    /*background: bg-black;*/
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* 卡片样式，设置卡片的背景、边框圆角、阴影和内边距 */
.card {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 30px;
    width: 90%;
    max-width: 500px;
    margin-bottom: 18px;
}

/* h1 标题样式，设置颜色、文本对齐方式和下边距 */
h1 {
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 18px;
}

/* 表单样式，设置为 flex 布局，垂直排列子元素 */
form {
    display: flex;
    flex-direction: column;
}

/* 表单标签样式，设置下边距和字体加粗 */
label {
    margin-bottom: 5px;
    font-weight: 600;
}

/* 输入框和选择框样式，设置内边距、边框、边框圆角和过渡效果 */
input,
select {
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* 输入框和选择框获得焦点时的样式，改变边框颜色和添加阴影 */
input:focus,
select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(106, 90, 205, 0.5);
    outline: none;
}

/* 按钮样式，设置背景渐变、文本颜色、边框、边框圆角、鼠标样式、阴影和过渡效果 */
button {
    background: linear-gradient(to right, var(--button-gradient-start), var(--button-gradient-end));
    color: white;
    padding: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 10px;
    width: 100%; 
}

/* 按钮鼠标悬停时的样式，向上移动并增加阴影效果 */
button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 结果展示区域样式，设置上边距、内边距、背景颜色、背景图片、背景大小、位置和边框圆角 */
.result {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--secondary-color);
    background-image: url('bg01.jpg');
    background-size: 100% 100%;
    background-position: center 0px;
    background-repeat: no-repeat;
    border-radius: 5px;
    position: relative;

}

/* 三角形容器样式，设置宽度、溢出隐藏和下边距 */
.triangle-container {
    width: 91%;
    overflow: hidden;
    margin-bottom: 10px;
}

/* 向下三角形样式，通过边框绘制三角形并居中 */
.downward-triangle {
    width: 0;
    height: 0;
    border-left: calc(50% - 1px) solid transparent;
    border-right: calc(50% - 1px) solid transparent;
    border-top: 20px solid var(--accent-color);
    margin: 0 auto;
}

/* 每行数字值的样式，设置为 flex 布局，水平排列子元素并均匀分布，设置对齐方式和下边距 */
.row-values {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 20px;
}

/* 空行样式，设置高度 */
.empty-row {
    height: 80px;
}

/* 每行数字值中的 span 元素样式，设置颜色、字体大小、背景、边框圆角、宽高、显示方式、对齐方式和过渡效果 */
.row-values span {
    color: var(--accent-color);
    font-size: 1.6em;
    background: radial-gradient(circle at 50% 30%, white, var(--circle-bg-color));
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: left;
    box-shadow: 0 4px 8px var(--circle-shadow-color), 0 6px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

/* 特定分组的 span 元素样式，修改背景颜色 */
.row-values span.group-eh {
    background: radial-gradient(circle at 50% 30%, white, var(--hermes-orange));
}

.row-values span.group-ij {
    background: radial-gradient(circle at 50% 30%, white, var(--hermes-orange));
}

.row-values span.group-nkt {
    background: radial-gradient(circle at 50% 30%, white, var(--vermillion-red));
}

/* 特定分组的 span 元素样式，设置更大的字体大小和背景颜色，用于突出显示 */
.row-values span.group-k {
    background: radial-gradient(circle at 50% 30%, white, var(--dark-orange));
    font-weight: bold;
    font-size: 2.6em;
    width: 46px;
    height: 46px;
    align-items:center;
}

/* span 元素鼠标悬停时的样式，放大元素 */
.row-values span:hover {
    transform: scale(1.1);
}

.row-values span.space-placeholder {
    background: none; /* 移除背景 */
    border-radius: 0; /* 移除边框圆角 */
    box-shadow: none; /* 移除阴影 */
    width: auto; /* 重置宽度 */
    height: auto; /* 重置高度 */
    display: inline; /* 重置显示方式 */
    justify-content: initial; /* 重置水平对齐方式 */
    align-items: initial; /* 重置垂直对齐方式 */
    font-size: inherit; /* 重置字体大小 */
    color: inherit; /* 重置字体颜色 */
}

/* 语言切换按钮容器样式，设置为 flex 布局，右对齐，设置下边距 */
.language-switch {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

/* 语言切换按钮样式，设置左边距 */
.language-switch button {
    margin-left: 10px;
}

/* 错误信息样式，设置颜色和下边距 */
.error-message {
    color: red;
    margin-bottom: 10px;
}

/* DNA 网格样式，设置为网格布局，定义列的自动适应和间距，设置上边距 */
.dna-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

/* DNA 单元格样式，设置背景颜色、边框圆角、内边距、文本对齐方式和过渡效果 */
.dna-cell {
    background-color: var(--secondary-color);
    border-radius: 5px;
    padding: 10px;
    text-align: center;
    transition: transform 0.3s ease;
}

/* 用户信息区域样式 */
.user-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}

/* 额外按钮样式 */
.extra-button {
    display: inline-block;
    background: linear-gradient(to right, var(--button-gradient-start), var(--button-gradient-end));
    color: white;
    padding: 8px 16px; /* 修改 padding 以匹配 login 和 logout 按钮 */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    margin-right: 0.3em;
    margin-bottom: 10px;
}

.extra-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 登录和注册按钮样式 */
.login-button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
}

.login-button:hover {
    background-color: #45a049;
}

/* 退出登录按钮样式 */
.logout-button {
    padding: 8px 16px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
}

.logout-button:hover {
    background-color: #d32f2f;
}

.custom-width {
  max-width: 800px;
  width: 91%;
  align-items: flex-start;
}

/* 统一全局容器样式 */
.global-container {
    width: 90%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 20px;
}


        /* 导航栏样式 */
        nav {
            background-color: #333;
            width: 100%;
            display: flex;
            justify-content: center;
            padding: 1rem 0;
        }

        nav a {
            color: white;
            text-decoration: none;
            margin: 0 1rem;
        }

        nav a:hover {
            text-decoration: underline;
        }


        .required-star {
            color: #dc2626;
            margin-left: 2px;
        }

        /* 在base.html的style区块中添加 */
.required-star {
    color: red;
    margin-left: 2px;
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gap-6 {
    gap: 1.5rem;
}