:root {
    --main-color: #5d87ff;
    --theme-color: var(--main-color);
    --art-gray-100: #f9fafb;
    --art-gray-200: #f2f4f5;
    --art-gray-300: #e6eaeb;
    --art-gray-400: #dbdfe1;
    --art-gray-500: #949eb7;
    --art-gray-600: #7987a1;
    --art-gray-700: #4d5875;
    --art-gray-800: #383853;
    --art-gray-900: #323251;
    --art-card-border: rgba(0, 0, 0, 0.08);
    --default-border: #e2e8ee;
    --default-bg-color: #fafbfc;
    --default-box-color: #ffffff;
    --art-hover-color: #edeff0;
    --art-active-color: #f2f4f5;
    --custom-radius: 0.75rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    color: #111;
    background: #fff;
}

::-webkit-scrollbar {
    width: 8px;
    height: 0;
}

::-webkit-scrollbar-track {
    background-color: var(--art-gray-200);
}

::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #b0abab;
}

.hero {
    width: 100vw;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
    padding: 20px;
}

.hero-inner {
    width: 100%;
    max-width: 960px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}

.app-logo {
    display: block;
}

.app-logo img {
    width: 160px;
    height: 160px;
    border-radius: 32px;
    object-fit: cover;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.app-name {
    font-size: 48px;
    font-weight: 700;
    color: #111;
}

.version {
    display: block;
    min-height: auto;
    padding: 0;
    color: #666;
    background: transparent;
    border-radius: 0;
    font-size: 16px;
}

.desc {
    max-width: 600px;
    padding: 0 20px;
    color: #333;
    font-size: 18px;
    line-height: 1.7;
}

.download {
    display: inline-block;
    min-width: 0;
    height: auto;
    margin-top: 10px;
    padding: 18px 60px;
    color: #fff;
    background: #007aff;
    border-radius: 50px;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 122, 255, 0.25);
    transition: all 0.3s ease;
}

.download:hover {
    background: #0066cc;
    opacity: 1;
    transform: translateY(-2px);
}

.android-download {
    min-width: 154px;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 18px 8px 14px;
    border-radius: 8px;
    text-align: left;
    line-height: 1.1;
}

.android-download img {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    object-fit: contain;
}

.android-download span {
    display: flex;
    flex-direction: column;
    color: #fff;
}

.android-download strong {
    font-size: 20px;
    font-weight: 700;
}

.android-download small {
    margin-top: 3px;
    font-size: 13px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .hero {
        padding: 10px;
    }

    .app-logo img {
        width: 140px;
        height: 140px;
        border-radius: 28px;
    }

    .app-name {
        font-size: 38px;
    }

    .desc {
        font-size: 17px;
    }

    .download {
        width: 85%;
        max-width: 380px;
        padding: 16px 50px;
        font-size: 17px;
    }

    .android-download {
        width: auto;
        max-width: none;
        padding: 8px 18px 8px 14px;
        font-size: 16px;
    }
}

@media (max-width: 380px) {
    .app-name {
        font-size: 34px;
    }

    .app-logo img {
        width: 120px;
        height: 120px;
    }
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--default-bg-color);
    padding: 20px;
}

.login-box {
    width: min(100%, 390px);
    padding: 28px;
    background: var(--default-box-color);
    border: 1px solid var(--art-card-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
}

.login-brand,
.sidebar-title {
    display: flex;
    align-items: center;
    color: var(--art-gray-800);
    font-size: 18px;
    font-weight: 600;
}

.login-brand {
    justify-content: center;
    margin-bottom: 22px;
}

.login-box h2 {
    margin-bottom: 22px;
    color: var(--art-gray-900);
    font-size: 22px;
    text-align: center;
}

.login-box input,
.form-item input,
.form-item textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    color: var(--art-gray-900);
    background: var(--default-box-color);
    border: 1px solid var(--default-border);
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-box input {
    margin-bottom: 16px;
}

.login-box input:hover,
.form-item input:hover,
.form-item textarea:hover {
    border-color: color-mix(in srgb, var(--theme-color) 60%, white);
}

.login-box input:focus,
.form-item input:focus,
.form-item textarea:focus {
    border-color: var(--theme-color);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-color) 18%, transparent);
}

.login-box button,
.primary-btn {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    color: #fff;
    background: var(--theme-color);
    border: 1px solid var(--theme-color);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.login-box button {
    width: 100%;
}

.login-box button:hover,
.primary-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.admin-page {
    min-height: 100vh;
    background: var(--default-bg-color);
}

.admin-layout {
    min-height: 100vh;
    display: flex;
    background: var(--default-bg-color);
}

.admin-sidebar {
    width: 230px;
    flex: 0 0 230px;
    min-height: 100vh;
    background: var(--default-box-color);
    border-right: 1px solid var(--art-card-border);
    transition: width 0.25s ease, flex-basis 0.25s ease;
    user-select: none;
}

.sidebar-title {
    height: 60px;
    padding: 0 22px;
    white-space: nowrap;
    overflow: hidden;
    border-bottom: 1px solid var(--art-card-border);
}

.sidebar-title-mini {
    display: none;
    width: 100%;
    text-align: center;
    color: var(--theme-color);
    font-size: 15px;
}

.side-nav {
    padding: 12px 0;
}

.side-group-title,
.side-link {
    width: calc(100% - 16px);
    min-height: 42px;
    margin-left: 8px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    color: #29343d;
    background: transparent;
    border: 0;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}

.side-group-title {
    gap: 8px;
    padding: 0 14px;
    font-weight: 600;
    cursor: pointer;
}

.side-group-title:hover {
    background: var(--art-hover-color);
}

.menu-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--theme-color);
}

.menu-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-arrow {
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-right: 1px solid var(--art-gray-600);
    border-bottom: 1px solid var(--art-gray-600);
    transform: rotate(45deg);
    transition: transform 0.25s ease;
}

.side-group.is-open .menu-arrow {
    transform: rotate(225deg);
}

.side-submenu {
    max-height: 128px;
    overflow: hidden;
    transition: max-height 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-group:not(.is-open) .side-submenu {
    max-height: 0;
}

.side-link {
    position: relative;
    padding: 0 18px 0 38px;
}

.side-link:hover {
    background: var(--art-hover-color);
}

.side-link.active {
    color: var(--theme-color);
    background: color-mix(in srgb, var(--theme-color) 10%, white);
    font-weight: 600;
}

.side-link.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--theme-color);
    border-radius: 6px 0 0 6px;
}

.admin-shell {
    flex: 1;
    min-width: 0;
    height: 100vh;
    overflow: auto;
}

.sidebar-collapsed .admin-sidebar {
    width: 64px;
    flex-basis: 64px;
}

.sidebar-collapsed .sidebar-title {
    justify-content: center;
    padding: 0 8px;
}

.sidebar-collapsed .sidebar-title-full,
.sidebar-collapsed .menu-name,
.sidebar-collapsed .menu-arrow,
.sidebar-collapsed .side-submenu {
    display: none;
}

.sidebar-collapsed .sidebar-title-mini {
    display: block;
}

.sidebar-collapsed .side-group-title,
.sidebar-collapsed .side-link {
    width: 46px;
    justify-content: center;
    padding: 0;
}

.sidebar-collapsed .menu-dot {
    width: 18px;
    height: 18px;
    background: color-mix(in srgb, var(--theme-color) 16%, white);
    border: 1px solid color-mix(in srgb, var(--theme-color) 45%, white);
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 20px;
    background: var(--default-box-color);
    border-bottom: 1px solid var(--art-card-border);
}

.topbar-left,
.topbar-actions,
.breadcrumb {
    display: flex;
    align-items: center;
}

.topbar-left {
    min-width: 0;
    gap: 12px;
}

.topbar-actions {
    gap: 10px;
}

.breadcrumb {
    min-width: 0;
    gap: 8px;
    color: var(--art-gray-500);
    font-size: 14px;
}

.breadcrumb strong {
    color: var(--art-gray-800);
    font-weight: 600;
}

.icon-button {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--art-gray-700);
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 18px;
    text-decoration: none;
    cursor: pointer;
}

.menu-toggle {
    flex-direction: column;
    gap: 4px;
}

.menu-toggle span {
    width: 16px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.icon-button:hover {
    color: var(--theme-color);
    background: var(--art-hover-color);
}

.user-chip {
    height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    color: var(--art-gray-700);
    background: var(--art-gray-100);
    border: 1px solid var(--art-card-border);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.user-menu {
    position: relative;
}

.user-menu summary {
    list-style: none;
}

.user-menu summary::-webkit-details-marker {
    display: none;
}

.user-chip::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-left: 8px;
    border-right: 1px solid var(--art-gray-600);
    border-bottom: 1px solid var(--art-gray-600);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.user-menu[open] .user-chip::after {
    transform: rotate(225deg) translate(-2px, -1px);
}

.user-dropdown {
    position: absolute;
    top: 40px;
    right: 0;
    z-index: 40;
    min-width: 112px;
    padding: 6px;
    background: var(--default-box-color);
    border: 1px solid var(--art-card-border);
    border-radius: 10px;
    box-shadow:
        0 6px 16px 0 rgba(0, 0, 0, 0.08),
        0 3px 6px -4px rgba(0, 0, 0, 0.12),
        0 9px 28px 8px rgba(0, 0, 0, 0.05);
}

.user-dropdown a {
    min-height: 34px;
    display: flex;
    align-items: center;
    padding: 6px 16px;
    color: var(--art-gray-800);
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}

.user-dropdown a:hover {
    color: var(--art-gray-900);
    background: var(--art-hover-color);
}

.layout-content {
    width: calc(100% - 40px);
    margin: 0 auto;
    padding: 20px 0 28px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.page-title {
    color: var(--art-gray-900);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
}

.page-desc {
    margin-top: 6px;
    color: var(--art-gray-600);
    font-size: 14px;
}

.page-content {
    position: relative;
    padding: 20px;
    overflow: hidden;
    background: var(--default-box-color);
    border: 1px solid var(--art-card-border);
    border-radius: 8px;
}

.tab-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.config-tabs {
    display: flex;
    gap: 24px;
    min-height: 44px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--art-card-border);
}

.config-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: var(--art-gray-600);
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.config-tab:hover {
    color: var(--theme-color);
}

.config-tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: transparent;
    border-radius: 2px;
}

#tab-basic:checked ~ .config-tabs .basic-tab,
#tab-info:checked ~ .config-tabs .info-tab {
    color: var(--theme-color);
    font-weight: 600;
}

#tab-basic:checked ~ .config-tabs .basic-tab::after,
#tab-info:checked ~ .config-tabs .info-tab::after {
    background: var(--theme-color);
}

.tab-panel {
    display: none;
}

#tab-basic:checked ~ .basic-panel,
#tab-info:checked ~ .info-panel {
    display: block;
}

.site-config-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.admin-account-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 640px);
    gap: 24px;
    align-items: start;
}

.preview-panel,
.form-panel {
    min-width: 0;
    padding: 20px;
    background: var(--default-box-color);
    border: 1px solid var(--art-card-border);
    border-radius: 8px;
}

.preview-logo {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: color-mix(in srgb, var(--theme-color) 10%, transparent);
    border-radius: 8px;
}

.preview-logo img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    border-radius: 18px;
}

.preview-name {
    color: var(--art-gray-900);
    font-size: 20px;
    font-weight: 600;
    word-break: break-word;
}

.admin-avatar {
    width: 92px;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: #fff;
    background: linear-gradient(135deg, #5d87ff 0%, #38c0fc 100%);
    border-radius: 18px;
    font-size: 38px;
    font-weight: 700;
}

.preview-title {
    margin-top: 6px;
    color: var(--art-gray-600);
    line-height: 1.7;
    word-break: break-word;
}

.preview-list {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.preview-list dt {
    margin-bottom: 4px;
    color: var(--art-gray-500);
    font-size: 12px;
}

.preview-list dd {
    color: var(--art-gray-800);
    font-size: 14px;
    word-break: break-all;
}

.form-panel h3 {
    margin: 0 0 18px;
    color: var(--art-gray-900);
    font-size: 18px;
    font-weight: 600;
}

.form-panel h3:not(:first-child) {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--art-card-border);
}

.form-item {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.form-item label {
    color: var(--art-gray-600);
    font-size: 13px;
}

.form-item textarea {
    min-height: 92px;
    resize: vertical;
}

.form-item input[type="color"] {
    width: 96px;
    padding: 4px;
    cursor: pointer;
}

.form-help {
    margin-top: 8px;
    color: var(--art-gray-600);
    font-size: 13px;
    line-height: 1.7;
}

.form-help code {
    padding: 2px 6px;
    color: var(--theme-color);
    background: color-mix(in srgb, var(--theme-color) 10%, white);
    border-radius: 4px;
    font-family: Consolas, Monaco, "Courier New", monospace;
}

.art-message {
    position: fixed;
    top: 24px;
    left: 50%;
    z-index: 3000;
    min-width: 168px;
    max-width: calc(100vw - 32px);
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--art-gray-900);
    background: var(--default-box-color);
    border: 0;
    border-radius: 10px;
    box-shadow:
        0 6px 16px 0 rgba(0, 0, 0, 0.08),
        0 3px 6px -4px rgba(0, 0, 0, 0.12),
        0 9px 28px 8px rgba(0, 0, 0, 0.05);
    transform: translateX(-50%);
    animation: message-in 0.28s cubic-bezier(0.32, 0.14, 0.15, 0.86), message-out 0.25s linear 2.6s forwards;
}

.art-message p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.message-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

.art-message-success .message-icon {
    background: #13deb9;
}

.art-message-error .message-icon {
    background: #ff4d4f;
}

.art-dialog-mask {
    position: fixed;
    inset: 0;
    z-index: 2900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.45);
    animation: fade-in 0.2s linear;
}

.art-dialog {
    width: min(100%, 420px);
    overflow: hidden;
    background: var(--default-box-color);
    border-radius: calc(var(--custom-radius) / 1.2 + 2px);
    box-shadow:
        0 6px 16px 0 rgba(0, 0, 0, 0.08),
        0 3px 6px -4px rgba(0, 0, 0, 0.12),
        0 9px 28px 8px rgba(0, 0, 0, 0.05);
    animation: dialog-open 0.3s cubic-bezier(0.32, 0.14, 0.15, 0.86);
}

.art-dialog-head {
    padding: 18px 20px 0;
    color: var(--art-gray-900);
    font-size: 16px;
    font-weight: 600;
}

.art-dialog-body {
    padding: 24px 20px;
    color: var(--art-gray-700);
    font-size: 14px;
    line-height: 1.7;
}

.art-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 20px 20px;
}

@keyframes message-in {
    0% {
        opacity: 0;
        transform: translate(-50%, -12px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

@keyframes message-out {
    100% {
        opacity: 0;
        transform: translate(-50%, -12px) scale(0.96);
        pointer-events: none;
    }
}

@keyframes dialog-open {
    0% {
        opacity: 0;
        transform: scale(0.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

@media (max-width: 960px) {
    .admin-layout {
        display: block;
    }

    .admin-sidebar {
        width: 100%;
        flex-basis: auto;
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--art-card-border);
    }

    .sidebar-collapsed .admin-sidebar {
        width: 100%;
    }

    .sidebar-collapsed .sidebar-title-full,
    .sidebar-collapsed .menu-name,
    .sidebar-collapsed .menu-arrow {
        display: inline;
    }

    .sidebar-collapsed .sidebar-title-mini {
        display: none;
    }

    .sidebar-collapsed .side-submenu {
        display: block;
    }

    .sidebar-collapsed .side-group-title,
    .sidebar-collapsed .side-link {
        width: calc(100% - 16px);
        justify-content: flex-start;
    }

    .sidebar-collapsed .side-link {
        padding: 0 18px 0 38px;
    }

    .sidebar-collapsed .side-group-title {
        padding: 0 14px;
    }

    .sidebar-collapsed .menu-dot {
        width: 7px;
        height: 7px;
        background: var(--theme-color);
        border: 0;
    }

    .side-nav {
        padding-bottom: 8px;
    }

    .admin-shell {
        height: auto;
        overflow: visible;
    }

    .site-config-grid,
    .admin-account-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .layout-content {
        width: calc(100% - 30px);
        padding-top: 15px;
    }

    .admin-topbar,
    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-topbar {
        height: auto;
        padding: 12px 15px;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .primary-btn {
        width: 100%;
    }

    .page-content,
    .preview-panel,
    .form-panel,
    .login-box {
        padding: 18px;
    }
}
