html {
    --brand-green: hsl(162, 87%, 21%);
    --dark-green: hsl(162, 88%, 30%);
    --medium-green: hsl(162, 73%, 46%);
    --text-color: hsl(0, 1%, 26%);
    --gray: hsl(210, 7%, 56%);
    --light-gray: hsl(210, 17%, 95%);
    --extra-light-gray: hsl(210, 17%, 98%);
    --white: hsl(0, 0%, 100%);
    --red: hsl(342, 63%, 46%);

    box-sizing: border-box;
    color: var(--text-color);
}

*,
*::before,
*::after {
    box-sizing: inherit;
}
@font-face {
    font-family: "SmileySans-Oblique";
    src: url("fonts/SmileySans-Oblique.ttf");
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif, "SmileySans-Oblique";
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: 0.02em;
    text-align: justify;
    background-color: var(--extra-light-gray);
    padding: 0;
}

.fonts-failed body {
    font-family: Helvetica, Arial, sans-serif;
}

h1,
h2,
h3,
h4 {
    font-family: Sansita, serif;
    letter-spacing: 0.03em;
}

.fonts-failed h1,
.fonts-failed h2,
.fonts-failed h3,
.fonts-failed h4 {
    font-family: Georgia, serif;
}

a {
    color: var(--medium-green);
}

a:visited {
    color: var(--brand-green);
}

a:hover {
    color: var(--brand-green);
}

a:active {
    color: var(--red);
    text-decoration: none;
    /* 去除下划线 */
}

p {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    white-space: normal;
}

p,
ul,
ol {
    margin-bottom: 1.5em;
    /* 段落、列表之间的间距 */
    white-space: normal;
}

.nav-container {
    background-color: var(--medium-green);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.nav-container__inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: nowrap;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0.625em 0;
    gap: 0.5rem;
}

.home-link {
    color: var(--text-color);
    font-size: 1.6rem;
    font-family: Sansita, serif;
    font-weight: bold;
    letter-spacing: 0.03em;
    text-decoration: none;
    flex: 1;
}

.home-link__label {
    display: inline-block;
}

.home-link:hover,
.home-link:focus {
    color: var(--medium-green);
    text-decoration: none;
}

.fonts-failed .home-link {
    font-family: Georgia, serif;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.top-nav>li+li {
    margin-left: 0.625em;
}

.top-nav a {
    display: block;
    font-size: 0.8rem;
    padding: 0.3rem 1.25rem;
    color: var(--white);
    background-color: var(--brand-green);
    border-radius: 3px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.top-nav a:hover,
.top-nav a:focus {
    background-color: var(--dark-green);
    color: var(--white);
}

.top-nav .badge {
    margin-left: 0.4rem;
}

.top-nav .search-icon {
    height: 32px;
    display: flex;
    border-radius: 3px;
    align-items: center;
}

.top-nav .search-icon input {
    height: 100%;
    width: 52px;
    border: none;
    outline: none;
    color: #000;
    font-size: 0.8rem;
    padding: 0 0.6rem;
    border-radius: 3px 0 0 3px;
}

.top-nav .search-icon input::placeholder {
    color: var(--gray);
}

.search-icon button img {
    width: 24px;
}

.search-icon button {
    border: 0;
    border-radius: 0 3px 3px 0;
    height: 100%;
    width: 30px;
    background: hsl(162, 87%, 21%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.post-body,
.post-body p,
.post-body span,
.post-content,
.list-group-item,
.list-group-item p,
.list-group-item span {
    overflow-wrap: break-word;
    word-break: break-word;
}

.post-body img,
.post-content img,
.list-group-item img,
.post-body iframe,
.post-content iframe,
.list-group-item iframe {
    max-width: 100%;
    height: auto;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: auto;
}

.nav-toggle__bar {
    width: 1.5rem;
    height: 2px;
    background: var(--white);
    margin: 0.2rem 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


.hero {
    background: url(images/hero.jpg);
    background-size: cover;
    margin-bottom: 2.5rem;
    animation: fade-in 1.5s ease-in-out;
}

@keyframes fade-in {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.hero__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 5em 6em 6em 0;
    text-align: right;
    overflow: hidden;
    position: relative;
}

.hero h2 {
    font-size: 1.95rem;
    letter-spacing: -0.02em;
    margin-top: 0;
    margin-bottom: 0.625rem;
}

.hero__inner img {
    width: 20%;
    height: auto;
    transition: transform 0.5s ease-out;
}

.hero__inner:hover img {
    transform: scale(1.1);
}
.button-div{
    text-align: center;
}

.button {
    display: inline-block;
    padding: 0.4em 1em;
    color: hsl(162, 87%, 21%);
    border: 2px solid hsl(162, 87%, 21%);
    border-radius: 3px;
    text-decoration: none;
    font-size: 0.8rem;
}

.button:hover {
    background-color: hsl(162, 15%, 44%);
    color: white;
}

.button--cta {
    padding: 0.6em 1em;
    background-color: hsl(162, 87%, 21%);
    color: white;
    border: none;
}

.container {
    margin: 0 auto;
    max-width: 1080px;
    padding: 0 1.5rem;
}

.tile-row {
    display: flex;
}

.tile-row>* {
    flex: 1;
}

.tile-row>*+* {
    margin-left: 1.5625em;
}

.tile {
    background-color: var(--white);
    border-radius: 3px;
    padding: 1.5625em;
    color: var(--clr-accent);
    border: 10px solid var(--clr-accent);
    transition: all 0.3s;
}

.tile:hover {
    transform: translateY(-10px);
    background-color: var(--clr-accent);
    color: var(--clr-light);
}

.tile>h4 {
    margin-top: 0;
    margin-bottom: 1.5em;
    white-space: normal;
}

.tag-list {
    list-style: none;
    padding-left: 0;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    counter-reset: num;
}

.tag-list>li {
    display: inline;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 0.2rem;
    background-color: var(--light-gray);
    line-height: 2.6;
    opacity: 0;
    transform: scale(.3);
    animation: show .8s forwards;
    transform-origin: left top;
}

.list li:nth-child(2n + 1) {
    background: tomato
}

.list li:nth-child(3n + 2) {
    background: royalblue
}

.list li:nth-child(9n + 3) {
    background: violet
}

.list li:nth-child(7n + 4) {
    background: tan;
    color: #000;
}

.list li:nth-child(11n + 5) {
    background: yellowgreen
}

/*animation-delay*/

.list li:nth-child(9n + 1) {
    animation-delay: 0s;
}

.list li:nth-child(9n + 2),
.list li:nth-child(9n + 4) {
    animation-delay: .3s;
}

.list li:nth-child(9n + 3),
.list li:nth-child(9n + 5),
.list li:nth-child(9n + 7) {
    animation-delay: .6s;
}

.list li:nth-child(9n + 6),
.list li:nth-child(9n + 8) {
    animation-delay: .9s;
}

.list li:nth-child(9n + 9) {
    animation-delay: 1.2s;
}

@keyframes show {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.page-footer {
    margin-top: 3em;
    padding: 1em 0;
    background-color: var(--light-gray);
    color: var(--gray);
}

.page-footer__inner {
    margin: 0 auto;
    max-width: 1080px;
    text-align: center;
    font-size: 0.8rem;
}

.addimg {
    border-radius: 1em;
    background-color: #f2f2f2;
    padding: 2px;
    border-radius: 1em;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.01em);
}

.wrap {
    overflow: hidden;
    border-radius: 10px 10px 10px 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.35);
}

    transition: all 0.3s ease-in-out;
}

@media (max-width: 992px) {
    .nav-container__inner {
        padding: 0.75em 1em;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 16.5px;
        line-height: 1.75;
    }

    .nav-container__inner {
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: flex;
    }

    .top-nav {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        padding: 0.75rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        gap: 0.5rem;
    }

    .top-nav:not(.top-nav--open) {
        display: none;
    }

    .top-nav>li {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .top-nav>li+li {
        margin-left: 0;
    }

    .top-nav a {
        width: 100%;
        text-align: center;
        font-size: 0.82rem;
        padding: 0.4rem 0.55rem;
    }

    .top-nav .search-icon {
        width: 100%;
        background-color: transparent;
    }

    .top-nav .search-icon input {
        width: 100%;
    }

    .hero__inner {
        padding: 3rem 1.5rem;
        text-align: center;
    }

    .hero__inner img {
        width: 40%;
        max-width: 180px;
    }

    .row {
        flex-wrap: wrap;
    }

    p,
    li {
        font-size: 1.02em;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 16px;
        line-height: 1.75;
    }

    .container {
        padding: 0 1rem;
    }

    .hero__inner {
        padding: 2.5rem 1rem;
    }

    .hero__inner img {
        width: 50%;
        max-width: 160px;
    }

    h1 {
        font-size: 1.75rem;
    }

    p {
        text-align: left;
        font-size: 1.04em;
    }
}

.scrollTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 10px 12px;
    background-color: hsl(162, 73%, 46%);
    color: hsl(162, 87%, 21%);
    border-radius: 5px;
    border-radius: 1px solid hsl(162, 87%, 21%);
    cursor: pointer;
    transition: all 0.5s ease 0s;
}

.scrollTop:hover {
    background-color: hsl(162, 87%, 21%);
    color: hsl(162, 73%, 46%);
}

blockquote {
    margin: 0 0 1.5em;
    /* 引用块之间的间距 */
    padding: 0 1.5em;
    /* 引用块内文字与边框的距离 */
    border-left: 4px solid hsl(162, 73%, 46%);
    /* 左边框样式 */
    white-space: normal;
}

blockquote p:last-child {
    margin-bottom: 0;
    /* 去除引用块最后一个段落的底部间距 */
    max-width: 100%;
    white-space: normal;
}

blockquote p {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    text-indent: 2em;
    /* 首行缩进 */
    white-space: normal;
}

pre {
    font-family: Consolas, "Courier New", monospace;
    /* 使用等宽字体 */
    font-size: 14px;
    /* 设置字体大小 */
    line-height: 1.5;
    /* 设置行高 */
    background-color: #f5f5f5;
    /* 背景色 */
    padding: 1em;
    /* 内边距 */
    overflow-x: auto;
    /* 横向滚动条 */
    max-width: 100%;
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-word;
}

code {
    display: inline-block;
    padding: 2px 4px;
    font-size: 14px;
    font-family: Consolas, Menlo, Monaco, source-code-pro, Courier New, monospace;
    background-color: #f7f7f9;
    border-radius: 3px;
    line-height: 1.4;
    color: #333;
    white-space: normal;
}

.post-body,
.post-body p,
.post-body span,
.post-body div,
.post-content,
.post-content p,
.post-content span,
.post-content div,
.list-group-item,
.list-group-item p,
.list-group-item span {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.post-body img,
.post-content img,
.list-group-item img,
.post-body iframe,
.post-content iframe,
.list-group-item iframe {
    max-width: 100%;
    height: auto;
}

.post-body pre,
.post-content pre,
.list-group-item pre {
    font-size: 0.95em;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-body table,
.post-content table,
.list-group-item table {
    width: 100%;
    max-width: 100%;
    margin: 1.5rem 0;
    border-spacing: 0;
    border-collapse: collapse;
    table-layout: auto;
    background-color: var(--white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.post-body table thead th,
.post-content table thead th,
.list-group-item table thead th {
    background-color: var(--brand-green);
    color: var(--white);
    text-align: center;
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.post-body table th,
.post-body table td,
.post-content table th,
.post-content table td,
.list-group-item table th,
.list-group-item table td {
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.75rem 1rem;
    text-align: center;
    word-break: break-word;
    white-space: normal;
}

.post-body table tbody tr:nth-child(even),
.post-content table tbody tr:nth-child(even),
.list-group-item table tbody tr:nth-child(even) {
    background-color: rgba(17, 201, 164, 0.08);
}

.list-group-item .d-flex {
    flex-wrap: wrap;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .list-group-item .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .list-group-item img {
        margin-bottom: 0.5rem;
    }

    .post-body table,
    .post-content table,
    .list-group-item table {
        display: table;
        width: 100%;
        table-layout: auto;
        margin: 1rem 0;
    }

    .post-body table th,
    .post-body table td,
    .post-content table th,
    .post-content table td,
    .list-group-item table th,
    .list-group-item table td {
        text-align: center;
        white-space: normal;
        word-break: break-word;
    }

    .container {
        padding: 0 1rem;
    }
}

/* Style for the movie list */
.movie-list {
    list-style-type: none;
    padding: 0;
}

.movie-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #ccc;
}

.movie-info {
    font-weight: bold;
}

/* Style for action buttons */
.movie-actions {
    display: flex;
    gap: 10px;
}

.inline-form {
    display: inline-block;
    margin-left: 5px;
}

/* Form styling */
.movie-form .form-group {
    margin-bottom: 15px;
}

/* 龙猫图片 */
.totoro {
    display: block;
    margin: 0 auto;
    height: 100px;
}

.imdb {
    font-size: 12px;
    font-weight: bold;
    color: black;
    text-decoration: none;
    background: #F5C518;
    border-radius: 5px;
    padding: 3px 5px;
}


/* Custom button colors */
.btn-complete {
    background-color: #28a745 !important; /* Green */
    color: white !important;
    border: none;
}

.btn-incomplete {
    background-color: #ffc107 !important; /* Yellow */
    color: black !important;
    border: none;
}

/* Disable hover effect on disabled buttons */
.btn[disabled] {
    background-color: inherit !important;
    color: inherit !important;
    cursor: not-allowed;
}

/* Optional: Style for disabled buttons */
.btn[disabled].btn-complete {
    background-color: #28a745 !important;
    color: white !important;
}

.btn[disabled].btn-incomplete {
    background-color: #ffc107 !important;
    color: black !important;
}
/* Remove global flex-wrap: nowrap from .row */
.specific-container .row {
    display: flex;
    flex-wrap: nowrap;
}

/* Keep default row behavior for posts and categories */
.row {
    display: flex;
    flex-wrap: wrap;
}

/* Optional: Styling for category links and badges */
.category-link {
    text-decoration: none;
    color: inherit;
}

.category-link:hover {
    color: #11c9a4;
}

.badge-pill {
    border-radius: 50%;
    padding: 10px;
    font-size: 14px;
    background-color: #11c9a4;
    color: white;
    width: 35px;
    height: 35px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}
