:root, * {
    box-sizing: border-box;
    --main-color: #8ACF00;
    --main-fontfamily: arial_narrowregular, "Arial Narrow", sans-serif;
    width: 100%;
    font-family: "Arial Narrow", sans-serif;
    --tx: 0px;
    --ty: 0px;
    --secondary-color: #7CA52A;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --text-gray: #666;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

.flex-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

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

h1, h2, h3 {
    font-family: var(--main-fontfamily);
    margin-bottom: 16px;
}

body {
    margin: 0 auto;
    padding: 0 16px;
    background-color: #fafafa;
    color: #333;
    line-height: 1.6;
}

body, main {
    width: 100%;
    max-width: 1200px;
}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
}

nav {
    width: 100%;
    height: auto;
    padding: 8px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

nav a {
    text-decoration: none;
    width: fit-content;
    color: #333;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 6px;
    transition: var(--transition);
}

nav a:hover {
    background-color: var(--light-gray);
    color: var(--main-color);
}

.slogan {
    text-align: center;
    margin: 32px 0;
}

.slogan p {
    color: var(--text-gray);
    font-size: 18px;
    max-width: 800px;
    margin: 0 auto;
}

.title {
    background-color: var(--main-color);
    width: fit-content;
    font-family: var(--main-fontfamily);
    font-size: 24px;
    padding: 8px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: 0 8px;
}

.title h1, .title h2 {
    filter: blur(1px);
    text-align: center;
    font-family: var(--main-fontfamily);
    margin: 0;
    color: black;
}

.title a {
    text-decoration: none;
    width: fit-content;
    padding: 0;
    border-radius: 0;
}

.menu {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
    width: 50%;
    height: fit-content;
}

.menu span {
    text-align: center;
}

.lang {
    width: 128px;
    height: fit-content;
    background-color: var(--light-gray);
    border-radius: 8px;
    margin: 0 8px;
    text-align: center;
    padding: 12px;
    font-weight: bold;
    transition: var(--transition);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.lang:hover {
    background-color: var(--medium-gray);
}

.lang span {
    font-family: var(--main-fontfamily);
    font-size: 16px;
    width: fit-content;
}

.lang-icon {
    width: fit-content;
    /* border:1px solid black; */
    width: 24px;
    margin: 0 4px;
}

.app {
    height: auto;
    max-width: 1200px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 32px;
    margin: 32px auto;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.setting {
    /* flex: 1; */
    height: 800px;
    padding: 0 16px;
    min-width: 280px;
    max-width: 360px;
    overflow: auto;
    background: var(--light-gray);
    border-radius: 12px;
    padding: 20px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.setting h3 {
    border-bottom: 2px solid var(--main-color);
    padding-bottom: 8px;
    margin-top: 24px;
    color: #333;
}

.input-text {
    font-size: 16px;
    min-height: 100px;
    resize: vertical;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--medium-gray);
    transition: var(--transition);
    margin-bottom: 16px;
}

.input-text:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px rgba(154, 205, 50, 0.2);
    outline: none;
}

.official-setting {
    width: 100%;
    margin: 24px 0;
}

.official-brat-btn {
    border-radius: 12px;
    height: 40px;
    width: 40px;
    margin: 0 4px;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
}

.official-brat-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.official1 {
    background-color: var(--main-color);
}

.official2 {
    background-color: white;
    border: 1px solid var(--medium-gray); 
}

.official3 {
    background-color: black;
}

.official4 {
    background-color: #0A00AD;
    border: 2px solid #DE0100;
}

.official5 {
    background-color: var(--main-color);
    background-image: url('./imgs/official5-btn.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

.diy-style-list {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    margin: 16px 0;
    width: 100%;
}

.diy-style-list span {
    font-family: var(--main-fontfamily);
    margin: 8px 0;
    font-weight: bold;
    color: #444;
}

.diy-style-list button {
    font-family: var(--main-fontfamily);
    width: 80px;
    font-size: 14px;
    background-color: white;
    border: 1px solid var(--medium-gray);
    border-radius: 6px;
    padding: 8px;    
    cursor: pointer;
    transition: var(--transition);
    margin: 4px;
    font-weight: normal;
}

.diy-style-list button:hover, 
.diy-style-list button.active {
    background-color: var(--main-color);
    color: white;
    font-weight: bold;
    border-color: var(--main-color);
}

.input-num {
    width: 70px;
    margin: 2px;
    text-align: center;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--medium-gray);
    transition: var(--transition);
}

.input-num:focus {
    border-color: var(--main-color);
    outline: none;
}

.result {
    flex: 3;
    height: 100%;
    position: relative;
}

.output-container {
    border: 1px solid var(--medium-gray);
    border-radius: 12px;
    /* width: 800px; */
    height: 800px;
    min-height: 600px;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    flex-grow: 0;
    overflow: auto;
    background: white;
    padding: 20px;
}

.works {
    width: fit-content;  
    height: auto;   
}

.output {
    width: 600px;
    height: 600px;
    background-color: var(--main-color);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 16px;
    overflow: hidden;
    position: relative;    
}

.output p {
    margin: 0;
    width: 100%;
    font-size: 100px;
    filter: blur(2px);
    overflow-wrap: anywhere;   
    color: black;
}

.brat-bg {
    position: absolute;
}

.brat-text {
    transform: translate(var(--tx), var(--ty));
}

.output-btn {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 24px;
    padding: 0 16px;
}

.output-btn div {
    margin: 0;
    width: fit-content;
}

.output-btn button {
    width: 140px;
    background-color: white;
    border: 2px solid var(--main-color);
    height: 42px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    margin: 0 8px;
    transition: var(--transition);
    color: #333;
}

#download {
    background-color: var(--main-color);
    color: white;
    border: none;
}

#download:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

#reset:hover {
    background-color: var(--light-gray);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.gallery {
    height: auto;
    text-align: center;
    padding: 60px 0;
    /* background: linear-gradient(to bottom, #fafafa, white); */
    margin: 64px 0;
    border-radius: 16px;
}

.intro {
    margin-top: 64px;
    height: auto;
    text-align: center;
    overflow-wrap: anywhere;
    padding: 40px 0;
}

.cards-container {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    gap: 32px;
    margin: 32px 0;
}

.card {
    text-align: left;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    flex: 1;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    margin: 8px 0;
}

.card a {
    text-decoration: none;
    width: fit-content;
    color: #333;
    font-weight: bold;
    transition: var(--transition);
}

.card a:hover {
    color: var(--main-color);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.card h3 {
    color: var(--main-color);
    font-size: 1.4rem;
}

.card p {
    color: var(--text-gray);
    flex-grow: 1;
    margin: 2px 0;
}

footer {
    width: 100%;
    height: auto;
    text-align: center;
    margin: 64px 0 32px 0;
    padding: 32px 0;
    background: #f0f0f0;
    border-radius: 16px;
}

footer p {
    margin: 8px;
    color: #666;
}

.carousel-container {
    width: 100%;
    max-width: 1200px;
    margin: 32px auto;
    overflow: hidden;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    padding: 10px 0;
}

.carousel-wrapper {
    display: flex;
    animation: scroll 20s linear infinite;
    width: fit-content;
}

.carousel-wrapper2 {
    display: flex;
    animation: scroll2 20s linear infinite;
    width: fit-content;
}

.carousel-item {
    flex-shrink: 0;
    width: 300px;
    height: 240px;
    margin: 0 15px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    cursor: pointer;
}

.carousel-item:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 暂停动画 */
.carousel-container:hover .carousel-wrapper {
    animation-play-state: paused;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes scroll2 {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

.modal-content {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    object-fit: contain;
}

.close {
    position: absolute;
    top: -14px;
    right: 30px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: var(--transition);
}

.close:hover {
    color: var(--main-color);
    transform: scale(1.1);
}

.blogs-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.blogs-container div {
    border-radius: 8px;
    padding: 0 16px;
    border: 1px solid var(--medium-gray);
    transition: var(--transition);
}

.blogs-container div:hover {
    border: 1px solid var(--main-color);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.blogs-container h2 {
    cursor: pointer;
}

.time-mark {
    color: gray;
    font-size: 14px;
    text-align: right;
}

.start {
    margin: 64px auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #8ACF00, #7CA52A);
    padding: 60px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    color: white;
}

.start h2 {
    font-size: 2.2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 24px;
}

.start a {
    background-color: white;
    padding: 16px 40px;
    border-radius: 50px;
    color: var(--main-color);
    width: fit-content;
    text-decoration: none;
    font-weight: bold;
    margin: 16px;
    font-size: 1.2rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.start a:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    background-color: #f5f5f5;
}

.nav-tree a {
    text-decoration: none;
    cursor: pointer;
    font-weight: normal;
    color: gray;
}

.nav-tree a:hover {
    font-weight: bolder;
    color: black;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .app {
        flex-direction: column;
    }
    
    .setting, .result {
        width: 100%;
    }

    .setting {
        max-width: 100%;
        height: 300px;
        overflow: auto;
    }

    .setting h3 {
        padding-bottom: 0px;
        margin-top: 2px;
        color: #333;
    }

    .setting div {
        margin: 4px 0;
    }

    .setting textarea {
        margin: 0;
    }

    .output {
        width: 400px;
        height: 400px;
    }
    
    .output-container {
        min-height: 400px;
        height: 500px;
    }
    
    .cards-container {
        flex-direction: column;
        gap: 24px;
    }
    
    .menu {
        width: 60%;
    }
    
    .carousel-item {
        width: 250px;
        height: 200px;
    }
}

@media (max-width: 600px) {
    nav {
        flex-direction: column;
        padding: 0px;
        /* align-items: flex-start; */
        /* gap: 16px; */
    }

    .title {
        padding: 8px 12px;
    }

    .title h1, .title h2 {
        font-size: 18px;
    }

    .lang {
        position: absolute;
        right: 0;
        width: 90px;
        padding: 16px 0;
        background: transparent;
    }

    .lang:hover {
        background: none;
    }
    
    .menu {
        width: 100%;
    }

    .app {
        height: 90vh;
    }

    .setting {
        height: 300px;
    }

    .setting h3 {
        font-size: 16px;
    }

    .setting textarea {
        height: 42px;
        min-height: 42px;
    }

    .setting span {
        margin: 0;
        font-size: 14px;
    }

    .official-brat-btn {
        height: 20px;
    }

    .output-container {
        width: 100%;
        min-height: 400px;
        height: 400px;
    }
    
    .output {
        height: 300px;
        width: 300px;
    }
    
    .output p {
        font-size: 50px;
    }
    
    .output-btn {
        flex-direction: row;
    }

    .output-btn button {
        width: 90px;
        font-size: 16px;
    }

    .output-btn input {
        width: 40px;
    }
}