@import url("./main.css");

#inline {
    display: flex;
    justify-content: start;
    margin: auto;
}

h2#swal2-title {
    font-size: 24px;
    font-family: 'Source Sans Pro';
    color: theme('colors.metal');
}

div#swal2-html-container {
    font-size: 16px;
    font-family: 'Source Sans Pro';
    color: theme('colors.metal');
}

.swal2-popup .swal2-styled.swal2-confirm {
    background-color: #aaa !important;
    vertical-align: middle;
    padding: 0rem 3rem 0rem 3rem;
    color: #1b1f22 !important;
    font-weight: 300;

}

.swal2-popup .swal2-styled:focus {
    background-color: #ffffff !important;
    vertical-align: middle;
    color: #1b1f22 !important;
    font-weight: 300;
    padding: 0rem 3rem 0rem 3rem;
}

.swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled:hover {
    background-color: #ffffff !important;
    vertical-align: middle;
    color: #1b1f22 !important;
    font-weight: 300;
    padding: 0rem 3rem 0rem 3rem;
}


html::-webkit-scrollbar {
    width: 4px;
}

html::-webkit-scrollbar-track {
    background-color: #1b1f22;
}

html::-webkit-scrollbar-thumb {
    background: #4e4e4e;
    border-radius: 2px;
}

.table-finite-compression {
    white-space: normal;
    min-width: 50rem;
}

/* 轮播容器样式 */
.carousel-container {
    display: block;
}

/* 主轮播区域 卡片容器*/
.carousel-main {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background-color: rgba(27, 31, 34, 0.4);
}

/* 轮播轨道 卡片将在这里动态创建*/
.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    /* 确保卡片不换行 */
    flex-wrap: nowrap;
}

/* Snapshots 卡片样式 (适配轮播) */
.carousel-card {
    width: 100%;
    background-color: rgba(27, 31, 34, 1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.carousel-card .image.main.card-image {
    z-index: 1000;
    width: 100%;
    height: 100%;
    margin: 0;
}

/* 图片容器 */
.carousel-card img {
    max-width: 100%;
    max-height: 100%;
}

.card-text-block {
    position: absolute;
    bottom: 6px;
    left: 6px;

    text-align: left;
    height: auto;
    width: auto;

    line-height: 1rem;

    color: white;
    padding: 0.2rem 0.5rem 0.2rem 0.5rem;
    margin-right: 6px;
    display: inline-block;

    background-color: rgba(19, 21, 25, 0.5);
    border-radius: 4px;
    opacity: 0.6;
    z-index: 2000;
}

.carousel-card .card-text-block:hover {
    opacity: 1;
    background-color: rgba(19, 21, 25, 0.95);
}

@media screen and (max-width: 480px) {
    .card-text-block {
        max-width: 10rem;
    }
}

/* 卡片互动效果 */
.carousel-card::before {
    content: "";
    position: absolute;
    left: var(--x);
    top: var(--y);
    transform: translate(-50%, -50%);
    width: 100rem;
    height: 100rem;
    background: radial-gradient(var(--clr, #fff), transparent, transparent);
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 1;
}

.carousel-card:hover::before {
    opacity: 0.3;
}

.carousel-card::after {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 10px;
    background-color: rgba(27, 31, 34, 0.75);
    pointer-events: none;
    z-index: 2;
}

/* 缩略图区域 */
.carousel-thumbnails {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    padding: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(19, 21, 25, 0.1);
}

.carousel-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.carousel-thumbnails::-webkit-scrollbar-track {
    background: rgba(19, 21, 25, 0.1);
    border-radius: 3px;
}

.carousel-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.thumbnail {
    width: 100px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
    border: 2px solid transparent;
    background-color: rgba(27, 31, 34, 0.5);
}

.thumbnail:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.thumbnail.active {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.thumbnail::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(var(--clr, #fff), transparent, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thumbnail:hover::after {
    opacity: 0.3;
}

/* 导航按钮 */
.carousel-prev {
    left: 2%;
}

.carousel-next {
    right: 2%;
}

/* Navigation arrows */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

.carousel-btn i {
    font-size: 1rem;
    color: #fff;
}

.carousel-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-btn.disabled:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 轮播指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 10000;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.indicator:hover {
    background-color: rgba(255, 255, 255, 0.6);
}


/* 自动播放控制 */
.auto-play-control {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.7);
}

.auto-play-toggle {
    transition: all 0.3s ease;
    background-color: rgba(19, 21, 25, 0.3);
    box-shadow: none;
}

.auto-play-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.auto-play-toggle i {
    transition: color 0.3s ease;
}

.auto-play-toggle.active i {
    color: #4CAF50;
    margin-right: 2px;
}

.auto-play-toggle.active {
    background-color: rgba(76, 175, 80, 0.1);
}

:root {
    --pad: clamp(1rem, 2vw, 3rem);
}

.blog-sort-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 1rem;
    gap: 1rem;
}

.sort-label {
    font-size: 1rem;
    color: #FFF;
}

.sort-buttons {
    display: flex;
    gap: 0.5rem;
}

.sort-btn {
    display: flex;
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中 */
    width: 2rem;
    height: 2rem;
    border-radius: 1rem;
    padding: 0.0rem 0 0.0rem 0.16rem;
    font-size: 1rem;
    cursor: pointer;
    color: #666;
    box-shadow: none;
}

.sort-btn.active {
    background: #aaa;
    border-color: #aaa;
    color: white;
}

.category-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: -0.5rem;
}

.blog-count-badge {
    background: #fff;
    color: #aaa;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    padding: 0.1rem 0.5rem;
    font-weight: bold;
    text-align: center;
}

.blog-ol-wrapper>*+* {
    margin-top: var(--pad);
    font-family: "Open Sans", sans-serif;
}


.blog-ol {
    list-style: none;
    padding: 1.5rem;
    border: 0.1rem solid lightgrey;
    border-radius: 0.5rem;
    margin-top: 0rem;
}

.blog-ol {
    -ms-overflow-style: none;
    /* Internet Explorer 10+ */
    scrollbar-width: none;
    /* Firefox, Safari 18.2+, Chromium 121+ */
}

.blog-ol::-webkit-scrollbar {
    display: none;
    /* Older Safari and Chromium */
}

/* Google */
@supports (-webkit-appearance:none) and (not (overflow:-webkit-marquee)) and (not (-ms-ime-align:auto)) {
    .blog-ol {
        columns: 16rem;
        column-gap: calc(var(--pad) * 2);
        column-rule: 0.2rem dotted lightgrey;
    }

    .blog-li+.blog-li {
        margin-top: 1rem;
    }
}

/* Safari */
@supports (-webkit-appearance:none) and (overflow:-webkit-marquee) {
    .blog-ol {
        display: flex;
        flex: space-between;
        overflow: scroll;
    }

    .blog-li+.blog-li {
        margin-left: 1rem;
    }

    .blog-card {
        max-width: 20rem;
        min-width: 15rem;
    }
}


.blog-card {
    --y: calc(100% - 2rem);
    display: grid;
    grid-template-columns: minmax(3.75em, auto) 1fr;
    gap: 0 0.5em;
    background: radial-gradient(circle at 30% var(--y), rgb(50 50 50), rgb(27, 31, 34));
    color: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0.25rem 0.25rem 0.5rem rgb(0 0 0 / 0.17);
    position: relative;
    transition-duration: 0.5s;
}

.blog-card:hover {
    transition-duration: 0.5s;
    box-shadow: 0.25rem 0.25rem 0.5rem rgb(100 100 100 / 0.5);
}

.blog-card::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: 0;
    background-color: rgb(50 50 50);
    border-radius: 0.5rem;
    transition-duration: 0.5s;
}

.blog-card:hover::after {
    transition-duration: 0.5s;
    opacity: 1;
}

.blog-li a {
    text-decoration: none;
    border-bottom: 0;
}

.blog-li {
    display: block;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    break-inside: avoid;
}

.blog-card img {
    grid-column: 1 / 3;
    grid-row: 1;
    aspect-ratio: 1.8;
    object-fit: cover;
    width: 100%;
    display: block;
    z-index: 1000;
}

.blog-card::before {
    counter-increment: list-item;
    content: counter(list-item);
    font-weight: 700;
    font-size: 4.5em;
    letter-spacing: -0.125em;
    line-height: 1;
    color: white;
    grid-column: 1;
    grid-row: span 2;
    align-self: end;
    margin: 0 0 -0.15em -0.15em;
    z-index: 2000;
}

.blog-card span {
    grid-column: 2;
    z-index: 3000;
    margin-left: 0.5rem;
}

.blog-card span:first-of-type {
    font-weight: bold;
    font-size: 1rem;
    padding-top: 1.2rem;
    padding-right: 0.5rem;
    line-height: 1.2rem;
    margin-bottom: 0.5rem;
}

.blog-card span:last-of-type {
    font-size: 0.8rem;
    font-style: italic;
    padding-bottom: 1rem;
}

/* 展开全部按钮样式 */
.expand-all-btn {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: 'Source Sans Pro', sans-serif;
    box-shadow: none;
    padding: 0 1rem 0 1rem;
    height: 1.5rem;
	letter-spacing: 0rem;
	line-height: 2rem;
}

.expand-all-btn i {
    padding-left: 0.5rem;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

/* 展开状态的箭头旋转 */
.expand-all-btn.expanded i {
    transform: rotate(180deg);
}

.img-in-blog {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1rem;
}

.formula-in-blog {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    margin-top: -1rem;
}

#blogTitle {
    white-space: normal;
    letter-spacing: normal;
    text-transform: none;
}

#blogContent p {
    margin: 0 0 0.5rem 0;
    white-space: normal;
}

#blogContent h2 {
    margin: 1.5rem 0 1.5rem 0;
    white-space: normal;
    font-size: 1.75rem;
    text-transform: none;
    letter-spacing: 0.1rem;
}

#blogContent h3 {
    margin: 1rem 0 1rem 0;
    white-space: normal;
    font-size: 1.5rem;
    text-transform: none;
    letter-spacing: 0.086rem;
}

#blogContent h4 {
    margin: 0.75rem 0 0.75rem 0;
    white-space: normal;
    font-size: 1.25rem;
    text-transform: none;
    letter-spacing: 0.071rem;
}

#blogContent h5 {
    margin: 0.5rem 0 0.5rem 0;
    white-space: normal;
    font-size: 1.1rem;
    text-transform: none;
    letter-spacing: 0.05rem;
}

#blogContent ul,
ol {
    margin: 0 0 0.5rem 0;
}

#catalogue {
    position: fixed;
    width: auto;
    right: 1rem;
    max-width: calc((100vw - 64rem)/2);
    overflow-y: auto;
    max-height: 87%;
    background-color: rgba(27, 31, 34, 0.85);
    padding: 1.5rem 1.5rem 1.5rem 1.5rem;
    border-radius: 4px;
    z-index: 100;

    visibility: hidden;
    opacity: 0;

    -webkit-transition: all 0.5s linear;
    -moz-transition: all 0.5s linear;
    -ms-transition: all 0.5s linear;
    -o-transition: all 0.5s linear;
    transition: all 0.5s linear;
}

#catalogue ul {
    list-style: none;
    padding-left: 0;
    margin: 10px 0 0 0;
}

#catalogue li {
    margin: 8px 0;
    line-height: 1.4;
}

#catalogue a {
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    border-bottom: 0;
    padding: 1px 5px 2px 10px;
    white-space: nowrap;
}

#catalogue a.active {
    /* font-weight: bold; */
    color: black;
    background-color: rgba(255, 255, 255, 0.75);
    border-left: 5px solid #fff;
    padding: 1px 5px 2px 5px;
}

@media screen and (max-width: 1200px) {
    #catalogue {
        visibility: hidden !important;
        content: '';
    }
}

.shortcuts {
    width: 100%;
    margin-top: 2rem;
    display: flex;
    justify-content: space-around;
}

#catalogue::-webkit-scrollbar {
    height: 4px;
    width: 4px;
}

#catalogue::-webkit-scrollbar-track {
    background-color: #1b1f22;
}

#catalogue::-webkit-scrollbar-thumb {
    background: #4e4e4e;
    border-radius: 2px
}

/* Base Styles and Font */
:root {
    --primary-color: rgba(0, 0, 0, 0.2);
    --secondary-color: rgba(0, 0, 0, 0);
    --bg-light: rgba(0, 0, 0, 0.1);
    --text-dark: black;
    --transition-speed: 0.3s;
    --icon-height: 44px;
    /* Defined icon height for calculation */
    --expanded-width: 200px;
    /* Width of the content area for list items */
    --menu-item-count: 3;
    /* Number of list items */
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    background-color: var(--bg-light);
}

/* Menu Container Positioning - Fixed to the top-right */
.expand-menu-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;

    visibility: visible;
    opacity: 1;

    -webkit-transition: all 0.5s linear;
    -moz-transition: all 0.5s linear;
    -ms-transition: all 0.5s linear;
    -o-transition: all 0.5s linear;
    transition: all 0.5s linear;
}

/* The "More" Button / Icon */
.menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--icon-height);
    height: var(--icon-height);
    cursor: pointer;

    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-size: 20px;
    font-weight: 700;
    transition: transform var(--transition-speed),
        background-color calc(var(--transition-speed) * 2),
        border-radius calc(var(--transition-speed) * 2),
        box-shadow var(--transition-speed);

    /* Positioning is crucial: Anchor to the top right of the menu area */
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    /* Must be above the list */

    /* Initial shape: Fully rounded to look like a separate button when collapsed */
    border-radius: 50%;
}

/* Icon transformation when the container has the .expanded class */
.expand-menu-container.expanded .menu-icon {
    /* Change shape and color when checked to integrate with the list */
    transform: none;
    background-color: var(--secondary-color);

    /* New shape: Becomes a rectangle with only top-right and bottom-right corners rounded */
    border-radius: 0 8px 8px 0;
    box-shadow: none;
    /* Remove shadow to visually merge with the list's shadow */
}

/* The Expandable List (Initial State - Collapsed) */
.expandable-list {
    position: absolute;
    top: 0;
    right: 0;

    margin: 0;
    padding: 0;
    list-style: none;

    /* Initial size: matches the icon, hiding items */
    width: var(--icon-height);
    height: var(--icon-height);
    overflow: hidden;

    background-color: rgba(255, 255, 255, 0.6);

    border-radius: 50%;
    /* Rounded to match icon when collapsed */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

    /* Transitions */
    transition: width var(--transition-speed) ease-out,
        height var(--transition-speed) ease-out,
        border-radius var(--transition-speed),
        box-shadow var(--transition-speed),
        right var(--transition-speed) ease-out;
    /* Added missing right transition */

    z-index: 1;
    /* Below the icon */
}

/* Pseudo-element for the button background when the menu is open (visual integration) */
.expand-menu-container.expanded .expandable-list::before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: var(--icon-height);
    height: var(--icon-height);
    background-color: var(--secondary-color);
    /* Matches the checked icon color */
    border-radius: 0 8px 0 0;
    /* Top right radius */
    z-index: 2;
    /* Below the icon, above the list items */
}

/* Expanded State (When Container has .expanded Class) */
.expand-menu-container.expanded .expandable-list {
    /* Total width: Content area + Icon width */
    width: calc(var(--expanded-width) + var(--icon-height));

    /* Total height: 1 row for the button + 4 rows for items */
    height: calc((var(--menu-item-count) + 1) * var(--icon-height));

    /* Shift left: List's right edge moves left by 200px to make space for the expanded content */
    /* right: var(--expanded-width); */

    /* New shape: rectangular with rounded corners */
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* List Item Styling - Hidden initially */
.expandable-list li {
    padding: 0;
    height: 0;
    /* Initially zero height */
    line-height: var(--icon-height);
    opacity: 0;

    transition: height var(--transition-speed), opacity var(--transition-speed);

    text-align: right;
    /* Align text to the right side of the list area */
}

.expandable-list li a {
    display: block;
    padding: 0 16px;
    text-decoration: none;
    color: var(--text-dark);
    white-space: nowrap;
    transition: background-color 0.2s;
}

.expandable-list li a:hover {
    background-color: var(--bg-light);
}

/* Items are revealed in the expanded state */
.expand-menu-container.expanded .expandable-list li {
    height: var(--icon-height);
    /* Give items their full height */
    opacity: 1;
    /* Delay the opacity transition until the height transition is halfway complete */
    transition: height var(--transition-speed) ease-out,
        opacity 0.2s calc(var(--transition-speed) / 2);
}

/* Responsive Consideration for smaller screens */
@media (max-width: 600px) {
    .expand-menu-container {
        top: 1rem;
        right: 1rem;
    }

    :root {
        --icon-height: 38px;
        --expanded-width: 150px;
    }
}

#filing-icon {
    width: 0.6rem;
    opacity: 0.75;
    margin-right: 0.3rem;
    margin-left: 0.3rem;
}