* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background-color: #f3f5fa;
    color: #222;
    min-height: 100vh;
    opacity: 0;
    transition: opacity 0.4s ease;
}

body.loaded {
    opacity: 1;
}

.page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
}

.page--home {
    position: relative;
    background-image: var(--page-home-background, url("/static/img/default-bg.png"));
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;
    flex-direction: column;
    padding-top: 0;
}

.page--home::before {
    content: none;
}

.page--home > * {
    position: relative;
}

/* Home Header */
.home-header {
    width: 100%;
    padding: 40px 24px 24px;
    text-align: center;
    position: relative;
}

.home-header__content {
    max-width: 800px;
    margin: 0 auto;
}

.home-header__title {
    margin: 0 0 12px;
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #e8ecff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.home-header__subtitle {
    margin: 0;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@media (max-width: 767px) {
    .home-header {
        padding: 28px 16px 20px;
    }

    .home-header__title {
        font-size: 32px;
    }

    .home-header__subtitle {
        font-size: 14px;
    }
}

/* Search Bar */
.search-bar {
    position: relative;
    max-width: 560px;
    margin: 0 auto 28px;
    width: 100%;
}

.search-bar__input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    font-size: 15px;
    border: none;
    border-radius: 20px;
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    color: #1f2937;
    font-family: inherit;
}

.search-bar__input::placeholder {
    color: rgba(31, 41, 55, 0.5);
}

.search-bar__input:focus {
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 1);
}

.search-bar__icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(31, 41, 55, 0.4);
    pointer-events: none;
}

@media (max-width: 767px) {
    .search-bar {
        margin: 0 auto 20px;
    }

    .search-bar__input {
        padding: 14px 45px 14px 18px;
        font-size: 14px;
        border-radius: 16px;
    }
}

/* Home Stats */
.home-stats {
    text-align: center;
    margin-bottom: 32px;
}

.home-stats__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.home-stats__icon {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

@media (max-width: 767px) {
    .home-stats {
        margin-bottom: 24px;
    }

    .home-stats__item {
        font-size: 13px;
        padding: 8px 16px;
    }
}

/* Empty State */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state__icon {
    width: 64px;
    height: 64px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-state__text {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.empty-state__hint {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Home Footer */
.home-footer {
    width: 100%;
    padding: 32px 24px 24px;
    text-align: center;
    position: relative;
}

.home-footer__text {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.home-footer__link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 600;
}

.home-footer__link:hover {
    color: #ffffff;
    text-decoration: underline;
}

@media (max-width: 767px) {
    .home-footer {
        padding: 24px 16px 20px;
    }

    .home-footer__text {
        font-size: 13px;
    }
}

.page__title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #f8faff;
}

.page--home .container {
    width: 100%;
    max-width: 1000px;
    padding: 0 24px 32px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 960px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: center;
    justify-items: center;
}

@media (min-width: 768px) {
    .grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 48px;
        width: 100%;
        max-width: 860px;
        margin: 0 auto;
    }
}

@media (max-width: 767px) {
    .page {
        padding: 0;
    }
    .page--home .container {
        padding: 0 16px 24px;
    }
    .grid {
        gap: 20px;
    }
    .grid__image-wrapper {
        width: 90px;
        height: 90px;
    }
    .grid__image {
        width: 78px;
        height: 78px;
    }
    .grid__title {
        font-size: 16px;
    }
    .grid__item {
        padding: 24px 8px;
    }
}

.grid__item {
    position: relative;
    padding: 32px 12px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid__item:nth-child(1) { animation-delay: 0.05s; }
.grid__item:nth-child(2) { animation-delay: 0.1s; }
.grid__item:nth-child(3) { animation-delay: 0.15s; }
.grid__item:nth-child(4) { animation-delay: 0.2s; }
.grid__item:nth-child(5) { animation-delay: 0.25s; }
.grid__item:nth-child(6) { animation-delay: 0.3s; }
.grid__item:nth-child(7) { animation-delay: 0.35s; }
.grid__item:nth-child(8) { animation-delay: 0.4s; }
.grid__item:nth-child(n+9) { animation-delay: 0.45s; }

.grid__item:hover {
    transform: translateY(-6px);
}

.grid__image-wrapper {
    width: 100px;
    height: 100px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    /*background: rgba(0, 0, 0, 0.8);*/
    /*box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);*/
}

.grid__image {
    width: 86px;
    height: 86px;
    object-fit: cover;
    border-radius: 18px;
    background-color: #000;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
}

.grid__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #f4f6ff;
    text-align: center;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.page--auth {
    align-items: center;
    background: linear-gradient(160deg, #f3f5fb 0%, #e6ebff 100%);
}

.auth-card {
    width: 100%;
    max-width: 360px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 28px;
    padding: 40px 36px;
    box-shadow: 0 30px 80px rgba(87, 111, 255, 0.22);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.auth-card__title {
    margin: 0 0 28px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #1c2752;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form__field--checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.form__checkbox {
    width: 18px;
    height: 18px;
    accent-color: #5f6cf6;
}

.form__label--inline {
    margin: 0;
}

.form__tip {
    margin: 10px 0 0;
    font-size: 13px;
    color: #4b5575;
    background: rgba(94, 114, 228, 0.12);
    border-radius: 10px;
    padding: 10px 12px;
    line-height: 1.5;
}

.form__label {
    font-size: 14px;
    color: #4b5575;
    font-weight: 600;
}

.form__input {
    padding: 12px 15px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    background: rgba(243, 245, 255, 0.85);
}

.form__input:focus {
    border-color: #556cf6;
    box-shadow: 0 0 0 3px rgba(85, 108, 246, 0.25);
}

.form__input:invalid:not(:placeholder-shown) {
    border-color: #f43f5e;
}

.form__input:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

.button {
    border: none;
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.button--primary {
    background: linear-gradient(120deg, #5f6cf6 0%, #7a8bff 100%);
    color: #fff;
}

.button--primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px rgba(95, 108, 246, 0.35);
}

.button--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.button--primary:disabled:hover {
    transform: none;
    box-shadow: none;
}

.button--secondary {
    background: rgba(244, 246, 252, 0.9);
    color: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.flash-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    box-shadow: 0 12px 24px rgba(30, 64, 175, 0.08);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.flash--success {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.flash--error {
    background: rgba(244, 63, 94, 0.12);
    color: #b42318;
}

.flash--info {
    background: rgba(37, 99, 235, 0.12);
    color: #1570ef;
}

.page--admin {
    flex-direction: column;
    gap: 28px;
    background: linear-gradient(140deg, #eef1ff 0%, #f7f8fc 100%);
}

.admin-header {
    width: 100%;
    max-width: 1060px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 24px;
    padding: 20px 28px;
    box-shadow: 0 18px 36px rgba(93, 102, 165, 0.18);
}

.admin-header__title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #1d2655;
}

.admin-header__actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

@media (max-width: 767px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .admin-header__actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .admin-header__actions .button {
        flex: 1;
        min-width: 140px;
    }
}

.admin-content {
    width: 100%;
    max-width: 1060px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Admin Hero Section */
.admin-hero {
    background: linear-gradient(135deg, rgba(94, 114, 228, 0.08) 0%, rgba(138, 158, 255, 0.05) 100%);
    border-radius: 24px;
    padding: 32px 36px;
    border: 1px solid rgba(94, 114, 228, 0.15);
    box-shadow: 0 20px 48px rgba(54, 68, 140, 0.12);
    position: relative;
    overflow: hidden;
}

.admin-hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(94, 114, 228, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.admin-hero__badge {
    display: inline-block;
    padding: 8px 18px;
    background: linear-gradient(120deg, rgba(94, 114, 228, 0.18) 0%, rgba(138, 158, 255, 0.12) 100%);
    color: #3d4a8c;
    font-size: 13px;
    font-weight: 700;
    border-radius: 20px;
    margin-bottom: 18px;
    border: 1px solid rgba(94, 114, 228, 0.25);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 6px 16px rgba(94, 114, 228, 0.15);
}

.admin-hero__title {
    margin: 0 0 14px;
    font-size: 26px;
    font-weight: 700;
    color: #1d2655;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.admin-hero__text {
    margin: 0;
    font-size: 15px;
    color: #4b5575;
    line-height: 1.6;
    position: relative;
}

.admin-hero__text code {
    background: rgba(94, 114, 228, 0.12);
    color: #3d4a8c;
    padding: 4px 10px;
    border-radius: 8px;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(94, 114, 228, 0.2);
}

@media (max-width: 767px) {
    .admin-hero {
        padding: 24px 20px;
    }

    .admin-hero__title {
        font-size: 22px;
    }

    .admin-hero__text {
        font-size: 14px;
    }

    .admin-hero__badge {
        font-size: 12px;
        padding: 6px 14px;
    }
}

.stats {
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    padding: 28px 32px;
    box-shadow: 0 22px 52px rgba(46, 64, 139, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
}

.section-title {
    margin: 0 0 18px;
    font-size: 22px;
    font-weight: 700;
    color: #1f2b5b;
}

.stats__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

@media (min-width: 768px) {
    .stats__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.stats__item {
    background: linear-gradient(160deg, rgba(94, 114, 228, 0.12) 0%, rgba(94, 114, 228, 0.05) 100%);
    border-radius: 18px;
    padding: 18px 16px;
    text-align: center;
    border: 1px solid rgba(94, 114, 228, 0.18);
    box-shadow: 0 12px 32px rgba(94, 114, 228, 0.18);
    color: #1e255e;
}

.stats__label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: rgba(30, 37, 94, 0.75);
}

.stats__value {
    display: block;
    margin-top: 10px;
    font-size: 24px;
    font-weight: 700;
}

.editor {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 24px;
    padding: 28px 32px 32px;
    box-shadow: 0 24px 60px rgba(54, 68, 140, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
}

.editor__hint {
    margin: 0 0 18px;
    padding: 12px 16px;
    background: rgba(94, 114, 228, 0.12);
    border-left: 4px solid rgba(94, 114, 228, 0.55);
    border-radius: 14px;
    color: #24306b;
    font-size: 14px;
}

.editor__grid {
    /*display: grid;*/
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 26px;
    padding: 12px 6px;
}

.editor__card {
    border-radius: 18px;
    padding: 22px 22px 26px;
    margin: 0;
    background: rgba(243, 244, 255, 0.9);
    border: 1px solid rgba(104, 117, 245, 0.22);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.editor__card--background {
    margin-bottom: 24px;
}

.editor__card:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 8px 24px rgba(104, 117, 245, 0.15);
}

.editor__legend {
    font-weight: 700;
    margin-bottom: 14px;
    color: #303a7a;
}

.editor__preview {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

.editor__preview-image {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 18px;
    box-shadow: 0 14px 30px rgba(31, 41, 79, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.65);
    background: #000;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.editor__preview--background {
    justify-content: center;
}

.editor__preview-image--background {
    width: 100%;
    max-width: 420px;
    height: 220px;
    border-radius: 20px;
    object-fit: cover;
}

.editor__preview-image:hover {
    transform: scale(1.05);
}

.editor__meta {
    font-size: 13px;
    color: #4f5b8f;
    margin-bottom: 14px;
    word-break: break-all;
    background: rgba(255, 255, 255, 0.6);
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(104, 117, 245, 0.15);
}

.editor__meta-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #3d4a8c;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.editor__meta-value {
    display: block;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 12px;
    color: #5e72e4;
    background: rgba(94, 114, 228, 0.08);
    padding: 6px 10px;
    border-radius: 8px;
    word-break: break-all;
    border: 1px solid rgba(94, 114, 228, 0.15);
    margin-top: 4px;
}

.editor__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 28px;
}

.form__input--file {
    padding: 10px;
    background: rgba(244, 246, 252, 0.92);
}

