/* JennyEngine X 样式 */
/* 通用样式 */
*{
    text-decoration: none;
    list-style: none;
    font-family: "Nunito", sans-serif;
}

header {
    background-color: var(--je-header-bg, #333);
    color: var(--je-header-fg, white);
    text-align: center;
    padding: 10px 0;
    box-shadow: 0 1px 2px var(--je-shadow-color, #444);
}

header h1 {
    margin: 0;
}

body {
    background-color: var(--je-body-bg, #f4f4f4);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-wrapper {
    flex: 1;
}

footer {
    background-color: var(--je-header-bg, #333);
    color: var(--je-header-fg, white);
    text-align: center;
    padding: 10px 0;
    box-shadow: 0 -1px 2px var(--je-shadow-color, #444);
}

nav {
    height: 45px;
    background-color: var(--je-nav-bg, #222);
    box-shadow: 0 1px 2px var(--je-shadow-color, #444);
}

.dropdown {
    position: relative;
    float: left;
    z-index: 1;
}

.dropdown_list {
    min-width: 75px;
    padding-left: 10px;
    padding-right: 10px;
    line-height: 45px;
    text-align: center;
}

.dropdown_list a {
    color: var(--je-nav-fg, #fff);
    display: block;
}

.dropdown_list:hover {
    background-color: var(--je-nav-hover, #444);
}

/* 下拉菜单：深色/浅色导航之下的「独立浮层」，与背景有明显区分度
   （白色卡片 + 描边 + 阴影；hover 用主题色填充，文字反白） */
.dropdown_content {
    position: absolute;
    display: none;
    background-color: var(--je-dropdown-bg, #fff);
    color: var(--je-dropdown-fg, #111827);
    min-width: 160px;
    width: max-content;
    max-width: 260px;
    top: 100%;
    left: 0;
    padding: 6px;
    border: 1px solid var(--je-border, #d1d5db);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    z-index: 70;
}

.dropdown_content a {
    display: block;
    color: var(--je-dropdown-fg, #111827);
    padding: 8px 12px;
    border-radius: 8px;
    white-space: nowrap;
}

.dropdown_content a:hover {
    background-color: var(--je-primary, #111827);
    color: #fff;
}

.dropdown:hover .dropdown_content {
    display: block;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

.section {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--je-card-bg, #fff);
    border: 1px solid var(--je-border, #ddd);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.section h2 {
    color: var(--je-heading, #333);
}

/* 模块样式 */
.container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

.section {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--je-card-bg, #fff);
    border: 1px solid var(--je-border, #ddd);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.section h2 {
    color: var(--je-heading, #333);
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse; /* 合并边框 */
    border: 1px solid #ddd; /* 添加表格边框 */
}

th {
    background-color: #f2f2f2;
    text-align: center;
    padding: 10px;
    border: 1px solid #ddd; /* 添加单元格边框 */
}

td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd; /* 添加单元格边框 */
}

/* 添加表格固定布局样式，解决滚动问题 */
div[style*="overflow-x:auto"] {
    overflow-x: auto;
}

div[style*="overflow-x:auto"] table {
    table-layout: auto;
    min-width: 1200px;
    width: unset;
}

/* 为库存表格中的input元素设置特定宽度 */
div[style*="overflow-x:auto"] table td input[type="text"] {
    width: 120px; /* PR单号等文本输入框宽度 */
}

div[style*="overflow-x:auto"] table td input[type="number"] {
    width: 80px; /* 数字输入框宽度，适合4位整数+2位小数 */
}

/* 帖子样式，还需要打磨 */
.post_container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

.post_section {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--je-card-bg, #fff);
    border: 1px solid var(--je-border, #ddd);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10%, 100% 90%, calc(100% - 10px) 100%, 0 100%);
}

.post_section h2 {
    color: var(--je-heading, #333);
}

/* 自定义链接样式，广泛使用在a标签和input标签。 有默认功能、新功能（红点）、开发中功能（蓝点）三种样式。*/
.custom-link {
    display: inline-block;
    padding: 10px 20px;
    margin-right: 10px;
    margin-bottom: 10px;
    color: #fff;
    background-color: var(--je-accent, #000000);
    border: none;
    border-radius: 5px;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
}

.custom-link:hover {
    background-color: var(--je-accent-hover, #3D3D3D);
    transform: scale(1.02);
}

.custom-link:active {
    background-color: #6C6C6C;
    transform: scale(0.98);
}

.custom-link-new::before {
    content: "";
    position: absolute;
    top: -5px;
    right: -5px;
    width: 10px;
    height: 10px;
    background-color: #FF0000;
    border-radius: 50%;
    z-index: 1;
}

.custom-link-new:active::before {
    transform: scale(0.98);
}

.custom-link-coming::before {
    content: "";
    position: absolute;
    top: -5px;
    right: -5px;
    width: 10px;
    height: 10px;
    background-color: #0095FF;
    border-radius: 50%;
    z-index: 1;
}

.custom-link-coming:active::before {
    transform: scale(0.98);
}

/* 按钮样式，一般用在表格里，按钮为绿色或灰色（表示不可用），悬停后会变成蓝色，点击后会变成橙色，悬停及点击会缩小。 */
.action-buttons {
    /* display: flex; */
    justify-content: center;
}

.button {
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button:hover {
    background-color: #5A8ED5;
    transform: scale(0.98);
}

.button:active {
    background-color: Orange;
    transform: scale(0.90);
}

.button2 {
    background-color: Gray;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 开关样式 */
.post-info {
    display: flex;
    align-items: center; /* 垂直居中对齐 */
}

.post-info p {
    margin: 0; /* 移除默认的段落间距 */
    margin-right: 10px; /* 在文本和开关之间添加一些间距 */
}

.switch {
    position: relative;
    display: inline-block;
    width: 45px; /* 宽度 */
    height: 24px; /* 高度 */
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px; /* 圆点的高度 */
    width: 20px; /* 圆点的宽度 */
    left: 2px; /* 初始位置 */
    bottom: 2px; /* 初始位置 */
    background-color: var(--je-card-bg, #fff);
    -webkit-transition: .4s;
    transition: .4s;
    box-shadow: 0 1px 1px #aaa;
}

input:checked + .slider {
    background-color: var(--je-accent, black);
}

input:checked + .slider:before {
    -webkit-transform: translateX(20px); /* 移动距离 */
    -ms-transform: translateX(20px);
    transform: translateX(21px);
}

.slider.round {
    border-radius: 24px; /* 圆角 */
    box-shadow: 2px 1.5px 2px 0 #aaa;
}

.slider.round:before {
    border-radius: 50%;
}

/* 弹窗样式 */
.popup-overlay {
    display: none; /* 默认隐藏 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--je-overlay, rgba(0,0,0,0.2));
    z-index: 999; /* 覆盖其他元素 */
}

.popup {
    display: none; /* 默认隐藏 */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    padding: 25px 30px;
    text-align: center;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: fadeInScale 0.3s ease forwards;
    transition: all 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}


.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.close-btn:hover {
  color: gray;
}

.delete-btn {
    background-color: transparent; /* 透明背景 */
    border: none; /* 无边框 */
    font-size: 15px; /* 字号 */
    color: gray;
    cursor: pointer; /* 指针样式 */
    padding: 5px 10px; /* 内边距 */
    position: absolute; /* 绝对定位 */
    top: 10px; /* 距离顶部 */
    right: 10px; /* 距离右侧 */
    transition: color 0.3s ease; /* 颜色过渡效果 */
}

.delete-btn:hover {
    color: black;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* 一言：左侧文本（悬停可点击复制），右侧「换一条」图标 */
#hitokoto {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    position: relative;
    cursor: pointer;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}
.hitokoto-text {
    flex: 1 1 auto;
    color: var(--je-header-fg, white);
    line-height: 1.7;
}
.hitokoto-refresh {
    flex: 0 0 auto;
    margin-top: 2px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--je-header-fg, white);
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s ease, background 0.15s ease;
}
.hitokoto-refresh:hover {
    opacity: 1;
    background: rgba(127, 127, 127, 0.25);
}
.hitokoto-copied {
    position: absolute;
    right: 0;
    bottom: 100%;
    margin-bottom: 6px;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--je-accent, #111827);
    color: var(--je-on-accent, #fff);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    white-space: nowrap;
}
.hitokoto-copied.show {
    opacity: 1;
    transform: translateY(0);
}

/* 其它规则 */
textarea {
    resize: none;
} /* 不允许调节文本输入区域大小，如需要调节请覆盖本规则。 */