/* === CSS Variables & Reset === */
:root {
    --bg-color: #f4f4f4;
    --primary-color: #4CAF50;
    --secondary-color: #506f50;
    --text-color: #333;
    --border-color: #ccc;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

ul {
    list-style: none;
}

/* === Base Styles === */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    min-width: 460px;
    margin:20px auto;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 10px 20px;
}

/* === Typography === */
h1 {
    text-align: center;
    font-size: 24px;
    color: var(--secondary-color);
}

h2 {
    font-size: 18px;
    margin-top: 10px;
}

/* === Layout === */
.box {
    display: flex;
    flex-direction: row;
    gap: 20px;
    flex-wrap: wrap;
}

.box>div {
    flex: 1 1 45%;
}

/* === Form Elements === */
textarea,
input[type="text"],
input[type="file"] {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    box-shadow: var(--shadow);
    outline: none;
}

textarea {
    height: 150px;
    resize: none;
}

/* Focus States */
textarea:focus,
input[type="text"]:focus,
input[type="file"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

/* === Forms === */
form {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* === Buttons === */
.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.buttons button {
    flex: 0 0 120px;
    min-width: 120px;
    height: 40px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.buttons button:hover {
    background-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#confirm {
    width: 100%;
    padding: 10px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

#confirm:hover {
    background-color: var(--primary-color);
}


.group{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sourcesContainer .sources{
   flex-wrap: wrap;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.group label{
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.group-rules button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    max-width: fit-content;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.group-rules button:hover {
    background-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.group-rules ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0;
}



.group-rules li {
    flex: 0 0 49%;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.group-rules li .deleteBtn {
    flex: 0 0 auto;
    background-color: #ff4d4d;
    color: white; /* 文字颜色 */
    border: none;
    border-radius: 50%; /* 圆形 */
    width: 30px; /* 按钮宽度 */
    height: 30px; /* 按钮高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 4px;
}
.group-rules li .deleteBtn:hover {
    background-color: #e60000; /* 深红色 */
}

.group-rules li span {
    flex: 0 0 auto;
    margin-right: 10px;
    font-weight: bold;
}

.group-rules .group-name-input {
    margin-right: 10px;
    flex: 1 1 120px;
}

.group-rules .group-keywords-input {
    margin-right: 10px;
    flex: 1 1 auto;
    min-width: 150px;
}

/* === Description List === */
.description {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0;
}

.description li {
    background-color: #f0f0f0;
    border-radius: 8px;
    padding: 5px;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: var(--shadow);
    transition: transform 0.2s, background-color 0.3s;
}

.description li:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-4px);
}



@media screen and (max-width: 864px) {
    .description li {
        flex: 0 0 100%;
        font-size: 13px;
    }

    /* Note: The following rules were already covered by (max-width: 768px),
       but are repeated here for completeness if needed at this breakpoint.
       In practice, you might consolidate or adjust the breakpoints. */
    .box {
        flex-direction: column;
    }

    .box>div {
        flex: 0 0 100%;
    }

    textarea {
        height: 100px;
    }

    .group-rules li {
        flex: 0 0 100%;

    }
}