* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #17151f;
    background: #f7f6fb;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: rgba(255, 255, 255, .88);
    border-bottom: 1px solid #eeeaf8;
    backdrop-filter: blur(16px);
}

.brand,
.top-actions,
.title-row,
.hero-buttons,
.section-head,
.section-head > div {
    display: flex;
    align-items: center;
}

.brand {
    gap: 12px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    border-radius: 12px;
    background: linear-gradient(135deg, #8758ff, #5b2df3);
    box-shadow: 0 12px 30px rgba(105, 61, 246, .28);
}

.brand-title {
    font-size: 24px;
    font-weight: 900;
}

.brand-subtitle {
    color: #aaa2b8;
    padding-left: 12px;
    border-left: 1px solid #ece8f4;
}

.top-actions {
    gap: 14px;
}

.primary-btn,
.create-panel button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
    border-radius: 999px;
    padding: 12px 22px;
    background: linear-gradient(135deg, #7d55ff, #5f2eea);
    box-shadow: 0 14px 28px rgba(102, 57, 232, .25);
}

.icon-btn,
.avatar {
    border: 0;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 8px 20px rgba(34, 25, 58, .08);
}

.avatar {
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, #22202d, #8d6cff);
}

.layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    min-height: calc(100vh - 70px);
}

.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px 18px;
    background: #fff;
    border-right: 1px solid #f0edf7;
}

.sidebar nav {
    display: grid;
    gap: 12px;
}

.sidebar a {
    color: #252130;
    text-decoration: none;
    font-weight: 800;
    padding: 16px 22px;
    border-radius: 14px;
}

.sidebar a.active,
.sidebar a:hover {
    color: #6239e8;
    background: #f0eaff;
}

.hero-card p,
.create-panel p,
.work-card p {
    color: #91899f;
}

.hero-buttons button {
    border: 0;
    cursor: pointer;
    font-weight: 800;
    border-radius: 10px;
    padding: 12px 22px;
}

.content {
    padding: 32px;
}

.hero-card,
.stats,
.create-panel,
.gallery-section {
    max-width: 1120px;
    margin: 0 auto 22px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(39, 28, 77, .06);
}

.hero-card {
    display: grid;
    grid-template-columns: 1fr 430px;
    gap: 34px;
    padding: 34px;
    background: linear-gradient(105deg, #f1eaff, #fff 54%, #efe8ff);
}

.profile-hero-card {
    grid-template-columns: 1fr;
}

.profile-block {
    display: flex;
    gap: 26px;
    align-items: center;
}

.profile-block img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid #fff;
}

.title-row {
    gap: 12px;
}

.title-row h1 {
    margin: 0;
    font-size: 28px;
}

.title-row span {
    color: #ffe9a5;
    font-size: 12px;
    border-radius: 999px;
    padding: 4px 10px;
    background: #24212b;
}

.progress-label {
    margin-top: 16px;
    font-weight: 700;
}

.progress {
    overflow: hidden;
    height: 7px;
    width: 310px;
    margin: 10px 0 22px;
    border-radius: 999px;
    background: #ded9e9;
}

.progress i {
    display: block;
    height: 100%;
    width: 68%;
    background: linear-gradient(90deg, #6739ee, #915eff);
}

.hero-buttons {
    gap: 14px;
}

.hero-buttons button,
.hero-buttons a {
    background: #fff;
    border: 1px solid #d8d1e8;
}

.hero-buttons a {
    color: #17151f;
    text-decoration: none;
    font-weight: 800;
    border-radius: 10px;
    padding: 12px 22px;
}

.hero-buttons .ghost {
    color: #6840ed;
}

.create-panel {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 26px;
    padding: 26px;
    border: 1px solid #eee9ff;
}

.inline-create-panel {
    max-width: none;
    margin: 0 0 26px;
    background: linear-gradient(105deg, #fbf9ff, #fff 58%, #f2ecff);
    box-shadow: none;
}

.create-panel h2,
.gallery-section h2 {
    margin: 0 0 8px;
}

#createPanel form {
    display: grid;
    grid-template-columns: 1fr 150px 150px 120px;
    gap: 12px;
}

textarea,
select,
input {
    border: 1px solid #ebe6f5;
    outline: none;
    border-radius: 14px;
    background: #fbfaff;
}

textarea {
    min-height: 92px;
    resize: vertical;
    padding: 16px;
}

select,
input {
    height: 46px;
    padding: 0 14px;
}

.status {
    grid-column: 2;
    color: #6739ee;
    font-weight: 800;
}

.status[data-type="success"] {
    color: #167248;
}

.status[data-type="error"] {
    color: #a82424;
}

.inline-create-panel .status {
    grid-column: 2;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 24px 0;
}

.stats div {
    text-align: center;
    border-right: 1px solid #eeeaf5;
}

.stats div:last-child {
    border-right: 0;
}

.stats b {
    display: block;
    font-size: 28px;
}

.stats span {
    color: #5d5669;
    font-weight: 700;
}

.gallery-section {
    padding: 26px;
}

.section-head {
    justify-content: space-between;
    margin-bottom: 22px;
}

.section-head > div {
    gap: 12px;
}

.section-head > div:first-child {
    display: block;
}

.section-head > div:first-child p {
    margin: 0;
    color: #91899f;
    font-weight: 700;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.work-card {
    position: relative;
}

.work-image-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.work-card img,
.task-result img {
    width: 100%;
    aspect-ratio: 1.2 / 1;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(31, 25, 47, .08);
    cursor: zoom-in;
}

.more {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 0;
    border-radius: 8px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, .86);
}

.favorite-btn.active {
    color: #fff;
    background: #6739ee;
}

.work-actions {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease;
}

.work-image-wrap:hover .work-actions,
.work-actions.static-actions {
    opacity: 1;
    transform: translateY(0);
}

.image-action,
.secondary-btn,
.section-action {
    border: 1px solid rgba(255, 255, 255, .68);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    text-decoration: none;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(27, 24, 38, .68);
    backdrop-filter: blur(10px);
}

.secondary-btn,
.section-action {
    color: #6739ee;
    border-color: #e4ddf7;
    background: #fff;
    backdrop-filter: none;
}

.section-action {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.empty-card {
    padding: 40px;
    color: #91899f;
    text-align: center;
    border-radius: 16px;
    background: #fbfaff;
}

.inline-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    margin: 22px 0;
}

.inline-form button {
    border: 0;
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    border-radius: 14px;
    padding: 12px 22px;
    background: linear-gradient(135deg, #7d55ff, #5f2eea);
}

.table-list {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.table-list div {
    display: grid;
    grid-template-columns: 1fr 160px 140px;
    gap: 12px;
    align-items: center;
    padding: 16px;
    border-radius: 14px;
    background: #fbfaff;
}

.table-list span,
.table-list em {
    color: #91899f;
    font-style: normal;
}

.score-card {
    display: inline-block;
    margin: 10px 0 18px;
    color: #6739ee;
    font-size: 48px;
    font-weight: 900;
}

.recharge-card {
    margin-bottom: 22px;
}

.recharge-form {
    display: grid;
    grid-template-columns: 1fr 180px auto;
    gap: 14px;
    align-items: end;
    margin-top: 18px;
}

.recharge-form label {
    display: grid;
    gap: 8px;
    color: #433c50;
    font-weight: 800;
}

.recharge-form input,
.recharge-form select {
    width: 100%;
}

.recharge-form button {
    border: 0;
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    border-radius: 14px;
    padding: 13px 22px;
    background: linear-gradient(135deg, #7d55ff, #5f2eea);
    box-shadow: 0 14px 28px rgba(102, 57, 232, .25);
}

.task-hero,
.wallet-summary {
    max-width: 1120px;
    margin: 0 auto 22px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 22px;
    align-items: center;
    padding: 30px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(39, 28, 77, .06);
}

.task-hero h1,
.wallet-summary h1 {
    margin: 0 0 10px;
    font-size: 30px;
}

.task-hero p,
.wallet-summary p {
    margin: 0;
    color: #91899f;
    font-weight: 700;
}

.task-balance,
.wallet-summary > div {
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f4f0ff, #fff);
}

.task-balance span,
.wallet-summary span {
    display: block;
    color: #6b617c;
    font-weight: 900;
}

.task-balance b,
.wallet-summary b {
    display: block;
    margin: 6px 0;
    color: #2b2440;
    font-size: 42px;
    line-height: 1;
}

.task-balance em {
    color: #167248;
    font-style: normal;
    font-weight: 900;
}

.task-create-panel {
    align-items: start;
}

.task-create-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px 150px 120px;
    gap: 12px;
}

.task-list-section {
    overflow: hidden;
}

.task-list {
    display: grid;
    gap: 14px;
}

.task-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 18px;
    align-items: center;
    padding: 16px;
    border: 1px solid #eee9ff;
    border-radius: 16px;
    background: #fbfaff;
}

.task-card h3 {
    margin: 10px 0 8px;
    font-size: 18px;
}

.task-card p,
.task-card em {
    display: block;
    margin: 0;
    color: #91899f;
    font-style: normal;
    font-weight: 700;
}

.task-card em {
    margin-top: 8px;
    color: #5f566c;
}

.task-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 900;
    background: #eee8ff;
    color: #6739ee;
}

.task-status-running {
    color: #7a4d00;
    background: #fff2d3;
}

.task-status-succeeded {
    color: #167248;
    background: #e7fff3;
}

.task-status-failed {
    color: #a82424;
    background: #fff0f0;
}

.task-result {
    position: relative;
}

.task-result img {
    aspect-ratio: 1 / .78;
}

.static-actions {
    position: static;
    margin-top: 10px;
}

.static-actions .image-action {
    color: #6739ee;
    border-color: #e5def7;
    background: #fff;
    backdrop-filter: none;
}

.wallet-summary {
    grid-template-columns: 280px minmax(0, 1fr);
}

.wallet-summary > div {
    height: 100%;
}

.wallet-recharge-form {
    margin: 0;
}

.wallet-grid {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.wallet-panel {
    max-width: none;
    margin: 0;
}

.wallet-panel h2 {
    margin: 0 0 14px;
}

.wallet-panel-wide {
    grid-column: 1 / -1;
}

.compact-list div {
    grid-template-columns: minmax(0, 1fr) 160px 180px;
}

.content-message {
    max-width: 1120px;
    margin: 0 auto 22px;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.image-lightbox.open {
    display: flex;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 11, 20, .78);
    backdrop-filter: blur(12px);
}

.lightbox-panel {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
    display: grid;
    gap: 12px;
}

.lightbox-panel img {
    max-width: 100%;
    max-height: 78vh;
    justify-self: center;
    object-fit: contain;
    border-radius: 12px;
    background: #111;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

.lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    color: #211b33;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    background: #fff;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
}

.lightbox-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.lightbox-caption {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.lightbox-download {
    flex: 0 0 auto;
    color: #211b33;
    text-decoration: none;
    font-weight: 900;
    border-radius: 999px;
    padding: 9px 14px;
    background: #fff;
}

body.has-lightbox {
    overflow: hidden;
}

.work-card h3 {
    margin: 10px 0 4px;
    font-size: 16px;
}

.work-card p {
    display: flex;
    justify-content: space-between;
    margin: 0;
    font-size: 13px;
}

.pager {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 34px;
}

.pager button {
    border: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fff;
}

.pager button.active {
    color: #6739ee;
    background: #eee7ff;
}

.text-link {
    color: #6739ee;
    font-weight: 800;
    text-decoration: none;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(126, 85, 255, .18), transparent 30%),
        radial-gradient(circle at 80% 10%, rgba(174, 143, 255, .22), transparent 28%),
        #f7f6fb;
}

.auth-card {
    width: min(440px, 100%);
    padding: 38px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 28px 80px rgba(58, 38, 104, .16);
    backdrop-filter: blur(18px);
}

.install-card {
    width: min(620px, 100%);
}

.auth-brand {
    margin-bottom: 28px;
}

.auth-card h1,
.admin-card h1 {
    margin: 0 0 10px;
    font-size: 30px;
}

.auth-card p,
.admin-card p {
    margin: 0 0 24px;
    color: #91899f;
}

.auth-form,
.admin-form {
    display: grid;
    gap: 16px;
}

.auth-form input,
.auth-form select,
.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
}

.auth-form button,
.admin-form button {
    border: 0;
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    border-radius: 14px;
    padding: 14px 22px;
    background: linear-gradient(135deg, #7d55ff, #5f2eea);
    box-shadow: 0 14px 28px rgba(102, 57, 232, .25);
}

.email-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 10px;
}

.email-code-row button {
    padding: 0 12px;
    box-shadow: none;
}

.code-status {
    margin-top: -6px;
    color: #6739ee;
    font-size: 13px;
    font-weight: 800;
}

.checkbox-label {
    grid-column: 1 / -1;
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fbfaff;
}

.checkbox-label input {
    width: auto;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.auth-links a {
    color: #6739ee;
    font-weight: 800;
    text-decoration: none;
}

.form-error,
.form-success {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 800;
}

.form-error {
    color: #a82424;
    background: #fff0f0;
}

.form-success {
    color: #167248;
    background: #ecfff6;
}

.admin-wrap {
    padding: 34px;
}

.admin-card {
    max-width: 920px;
    margin: 0 auto;
    padding: 34px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(39, 28, 77, .08);
}

.admin-form {
    grid-template-columns: repeat(2, 1fr);
}

.admin-form h2 {
    grid-column: 1 / -1;
    margin: 20px 0 0;
}

.admin-form label {
    display: grid;
    gap: 8px;
    color: #433c50;
    font-weight: 800;
}

.admin-form label:has(textarea),
.admin-form button {
    grid-column: 1 / -1;
}

.admin-form textarea {
    min-height: 120px;
}

.model-fetch-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(103, 57, 238, .12);
    border-radius: 18px;
    background: linear-gradient(135deg, #fbf9ff, #f3efff);
}

.model-fetch-panel strong {
    display: block;
    margin-bottom: 4px;
    color: #221b35;
    font-size: 16px;
}

.model-fetch-panel p {
    margin: 0;
    color: #857c96;
    font-size: 13px;
    font-weight: 700;
}

.model-fetch-panel button {
    grid-column: auto;
    white-space: nowrap;
}

.model-fetch-status {
    min-width: 130px;
    padding: 9px 12px;
    border-radius: 999px;
    color: #6b617c;
    background: #fff;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.model-fetch-status.loading {
    color: #5f2eea;
    background: #efeaff;
}

.model-fetch-status.success {
    color: #167248;
    background: #e8fff4;
}

.model-fetch-status.error {
    color: #a82424;
    background: #fff0f0;
}

.admin-auth-page {
    background:
        radial-gradient(circle at 20% 20%, rgba(126, 85, 255, .20), transparent 30%),
        radial-gradient(circle at 80% 10%, rgba(20, 18, 35, .18), transparent 28%),
        #f7f6fb;
}

.admin-topbar {
    height: 76px;
    padding: 0 32px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 10px 30px rgba(38, 29, 78, .06);
}

.admin-topbar .brand-title {
    font-size: 22px;
}

.admin-topbar .brand-subtitle {
    padding-left: 0;
    border-left: 0;
    font-size: 13px;
}

.admin-login-card {
    border: 1px solid rgba(103, 57, 238, .10);
}

.admin-shell {
    display: grid;
    grid-template-columns: 286px minmax(0, 1fr);
    min-height: calc(100vh - 76px);
    background:
        radial-gradient(circle at 28% 0%, rgba(124, 85, 255, .10), transparent 34%),
        linear-gradient(180deg, #f8f7fc, #f3f1f8);
}

.admin-nav {
    position: sticky;
    top: 76px;
    display: grid;
    align-content: start;
    gap: 12px;
    height: calc(100vh - 76px);
    padding: 26px 18px;
    background: linear-gradient(180deg, #171622, #242039);
    box-shadow: 18px 0 45px rgba(23, 22, 34, .12);
}

.admin-nav-title {
    color: #83799f;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    margin: 4px 10px 10px;
}

.admin-nav a {
    position: relative;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 2px;
    align-items: center;
    color: #d9d3ef;
    text-decoration: none;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 18px;
    background: rgba(255, 255, 255, .04);
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.admin-nav a span {
    grid-row: 1 / span 2;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
}

.admin-nav a strong,
.admin-nav a em {
    display: block;
    min-width: 0;
}

.admin-nav a strong {
    font-size: 15px;
    font-weight: 900;
}

.admin-nav a em {
    color: #9f96b6;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.admin-nav a.active,
.admin-nav a:hover {
    color: #fff;
    border-color: rgba(143, 103, 255, .42);
    background: linear-gradient(135deg, #7d55ff, #5f2eea);
    transform: translateX(4px);
}

.admin-nav a.active em,
.admin-nav a:hover em {
    color: rgba(255, 255, 255, .75);
}

.admin-panel {
    padding: 36px;
}

.wide-card {
    max-width: 1280px;
}

.admin-hero {
    max-width: 1280px;
    margin: 0 auto 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 34px;
    border-radius: 28px;
    color: #fff;
    background:
        radial-gradient(circle at 78% 12%, rgba(255, 255, 255, .26), transparent 28%),
        linear-gradient(135deg, #1d1930, #6939ee 58%, #9d7aff);
    box-shadow: 0 24px 70px rgba(91, 45, 243, .22);
}

.admin-hero h1 {
    margin: 8px 0 10px;
    font-size: 34px;
}

.admin-hero p {
    max-width: 620px;
    margin: 0;
    color: rgba(255, 255, 255, .74);
    font-weight: 700;
}

.admin-hero .primary-btn {
    color: #5f2eea;
    background: #fff;
    box-shadow: 0 18px 36px rgba(26, 18, 52, .18);
    text-decoration: none;
    white-space: nowrap;
}

.admin-kicker {
    display: inline-flex;
    color: #ffe5a3;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}

.admin-stats div {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border: 1px solid #eee9ff;
    border-radius: 22px;
    background: linear-gradient(180deg, #fbf9ff, #fff);
    box-shadow: 0 16px 38px rgba(82, 56, 143, .08);
}

.admin-stats div::after {
    content: "";
    position: absolute;
    right: -24px;
    top: -24px;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: rgba(125, 85, 255, .10);
}

.admin-stats i {
    position: relative;
    z-index: 1;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 15px;
    background: #f0eaff;
    font-style: normal;
    font-size: 20px;
}

.admin-stats b {
    position: relative;
    z-index: 1;
    display: block;
    margin: 8px 0;
    font-size: 32px;
    line-height: 1;
}

.admin-stats span,
.admin-stats em {
    position: relative;
    z-index: 1;
    display: block;
    color: #91899f;
    font-style: normal;
    font-weight: 800;
}

.admin-stats span {
    color: #433c50;
}

.admin-table {
    display: grid;
    gap: 10px;
    overflow-x: auto;
}

.admin-table-head,
.admin-table-row {
    display: grid;
    gap: 12px;
    align-items: center;
    min-width: 820px;
    padding: 14px;
    border-radius: 14px;
}

.admin-table-head {
    color: #6d6478;
    font-weight: 900;
    background: #f1edfb;
}

.admin-table-row {
    background: #fbfaff;
}

.users-table .admin-table-head,
.users-table .admin-table-row {
    grid-template-columns: 1.2fr 1.6fr 130px 150px 100px;
}

.orders-table .admin-table-head,
.orders-table .admin-table-row {
    grid-template-columns: 1.5fr 1fr 120px 120px 150px;
}

.generation-table .admin-table-head,
.generation-table .admin-table-row {
    grid-template-columns: 90px 1.3fr 2fr 1fr 150px;
}

.recharge-orders-table {
    margin-top: 22px;
}

.recharge-orders-table .admin-table-head,
.recharge-orders-table .admin-table-row {
    grid-template-columns: 1.5fr 1.4fr 130px 100px 100px 150px 120px;
    min-width: 1180px;
}

.compact-admin-form {
    margin: 18px 0 24px;
    padding: 22px;
    border: 1px solid #eee9ff;
    border-radius: 20px;
    background: #fbfaff;
}

.compact-admin-form h2 {
    margin-top: 0;
}

.admin-log-thumb {
    width: 72px;
    height: 56px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(31, 25, 47, .10);
}

.admin-table-row button,
.danger-btn {
    border: 0;
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    border-radius: 12px;
    padding: 11px 16px;
    background: linear-gradient(135deg, #7d55ff, #5f2eea);
}

.danger-btn {
    background: linear-gradient(135deg, #ff5f6d, #d7263d);
}

.admin-gallery-list {
    display: grid;
    gap: 14px;
}

.admin-gallery-list article {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
    background: #fbfaff;
}

.admin-gallery-list img {
    width: 96px;
    height: 76px;
    object-fit: cover;
    border-radius: 12px;
}

.admin-gallery-list h3 {
    margin: 0 0 6px;
}

.admin-gallery-list p,
.admin-gallery-list em {
    margin: 0;
    color: #91899f;
    font-style: normal;
}

@media (max-width: 1100px) {
    .layout,
    .hero-card,
    .create-panel,
    .task-hero,
    .wallet-summary,
    .wallet-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: sticky;
        top: 70px;
        z-index: 9;
        display: block;
        padding: 10px 14px;
        border-right: 0;
        border-bottom: 1px solid #f0edf7;
        overflow-x: auto;
    }

    .sidebar nav {
        display: flex;
        gap: 8px;
        min-width: max-content;
    }

    .sidebar a {
        white-space: nowrap;
        border-radius: 999px;
        padding: 10px 14px;
        font-size: 14px;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    #createPanel form,
    .task-create-form {
        grid-template-columns: 1fr;
    }

    .admin-form,
    .admin-shell,
    .admin-stats {
        grid-template-columns: 1fr;
    }

    .admin-nav {
        position: static;
        height: auto;
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-hero {
        display: grid;
    }

    .inline-form,
    .recharge-form,
    .table-list div,
    .compact-list div,
    .task-card {
        grid-template-columns: 1fr;
    }

    .status {
        grid-column: auto;
    }

    .model-fetch-panel {
        grid-template-columns: 1fr;
    }

    .model-fetch-panel button,
    .model-fetch-status {
        width: 100%;
    }

    .wallet-panel-wide {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .topbar {
        height: auto;
        min-height: 64px;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
    }

    .brand {
        min-width: 0;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .brand-title {
        font-size: 20px;
    }

    .brand-subtitle,
    .icon-btn {
        display: none;
    }

    .top-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .top-actions .primary-btn,
    .top-actions .text-link {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .avatar {
        flex: 0 0 auto;
        width: 38px;
        height: 38px;
    }

    .sidebar {
        top: 108px;
    }

    .content {
        padding: 18px;
    }

    .hero-card,
    .profile-block {
        display: block;
    }

    .stats,
    .gallery,
    .admin-gallery-list article,
    .admin-nav {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1px;
        overflow: hidden;
    }

    .stats div {
        padding: 14px 8px;
        border-right: 0;
        background: #fff;
    }

    .progress {
        width: 100%;
    }

    .hero-buttons,
    .section-head,
    .lightbox-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-head > div {
        display: block;
    }

    .profile-block img {
        width: 92px;
        height: 92px;
        margin-bottom: 14px;
    }

    .task-hero,
    .wallet-summary,
    .gallery-section,
    .create-panel {
        padding: 20px;
        border-radius: 16px;
    }

    .task-balance b,
    .wallet-summary b {
        font-size: 34px;
    }

    .work-actions {
        position: static;
        margin-top: 10px;
        opacity: 1;
        transform: none;
    }

    .image-action {
        color: #6739ee;
        border-color: #e5def7;
        background: #fff;
        backdrop-filter: none;
    }

    .image-lightbox {
        padding: 14px;
    }

    .lightbox-close {
        top: 8px;
        right: 8px;
    }

    .lightbox-panel img {
        max-height: 70vh;
    }

    .admin-panel {
        padding: 18px;
    }

    .admin-hero,
    .admin-card {
        padding: 24px;
    }
}
