html {
    scrollbar-gutter: auto;
}

html,
body,
body * {
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
body *::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

body {
    min-width: 0;
    background: #faf9f8;
    font-size: 15px;
    --muted: #657182;
}

body:has(dialog[open]) {
    overflow: hidden;
}

#sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: 224px;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    background: #fff;
}

.cloud-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 88px;
    padding: 0 26px;
    color: var(--ink);
}

.cloud-brand .brand-mark {
    width: 35px;
    height: 35px;
}

.cloud-brand-title {
    font-size: 19px;
    font-weight: 800;
    line-height: 1.35;
}

.user-navigation {
    padding: 9px 16px 24px;
}

.user-nav-group {
    margin: 17px 14px 10px;
    color: #788392;
    font-size: 13px;
}

.user-nav-group:not(:first-child) {
    margin-top: 31px;
}

.user-navigation ul {
    padding: 0;
    list-style: none;
}

.user-nav-link {
    display: flex;
    align-items: center;
    gap: 13px;
    height: 46px;
    margin-bottom: 5px;
    padding: 0 15px;
    border-radius: 8px;
    color: #46505e;
    font-size: 15px;
    transition: color .18s, background .18s;
    font-weight: 600;
}

.user-nav-link:hover {
    color: var(--ink);
    background: #f8f8f8;
}

.user-nav-link.active {
    color: var(--accent);
    background: #fff0eb;
    font-weight: 600;
}

.user-nav-link .icon {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

#page-header {
    position: fixed;
    inset: 0 0 auto 224px;
    z-index: 20;
    height: 64px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 32px;
}

.header-title-wrap {
    color: var(--ink);
    font-size: 16px;
    font-weight: 600;
}

.action-link:hover {
    color: var(--accent);
}

#main-container {
    min-width: 0;
    min-height: 100vh;
    margin-left: 224px;
    padding-top: 64px;
    transition: opacity .12s;
}

#main-container.is-switching {
    opacity: .55;
    pointer-events: none;
}

.content {
    max-width: 1536px;
    margin: 0 auto;
    padding: 32px;
}

.page-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 76px;
    padding: 20px 25px;
    border-bottom: 1px solid #f0f1f3;
}

.card-heading h2 {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 16px;
    font-weight: 700;
}

.card-heading p {
    margin-top: 6px;
    font-size: 13px;
}

.card-content,
.table-footer {
    padding: 20px 25px;
}

.table-footer {
    border-top: 1px solid #f0f1f3;
    font-size: 13px;
}

.toolbar,
.row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#order-filters {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
    border-radius: 8px;
    background: #f6f7f8;
}

#order-filters::before {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc((100% - 16px) / 3);
    height: calc(100% - 8px);
    border-radius: 5px;
    background: var(--accent);
    content: '';
    transform: translateX(calc(var(--order-filter-index, 0) * (100% + 4px)));
    transition: transform .22s ease;
}

#order-filters .button {
    position: relative;
    z-index: 1;
    background: transparent;
    transition: color .22s ease;
}

#order-filters .button:hover {
    transform: none;
}

.order-table-wrap {
    transition: opacity .15s ease;
}

.order-table-wrap.is-loading {
    opacity: .4;
}

.button {
    min-width: 0;
    height: 43px;
    padding: 0 20px;
    font-size: 15px;
}

.button-small {
    height: 38px;
    padding: 0 18px;
    font-size: 14px;
}

.button-outline {
    border-color: #e0e3e8;
    background: #fff;
}

.button-quiet {
    color: #505b6b;
    background: #f6f7f8;
}

.button-quiet:hover {
    color: var(--ink);
    background: #eceef1;
}

.button-danger {
    color: #fff;
    background: #dc4b43;
}

.button-danger:hover {
    background: #c53b33;
}

.button:disabled {
    opacity: .55;
    cursor: default;
    transform: none;
}

.button:focus-visible,
.user-nav-link:focus-visible,
.dashboard-announcement:focus-visible,
.action-link:focus-visible,
.icon-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.text-muted {
    color: var(--muted);
}

.text-success {
    color: #319472;
}

.text-danger {
    color: #d04d44;
}

.text-warning {
    color: #b7802a;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
}

.field:last-child {
    margin-bottom: 0;
}

.field-grow {
    flex: 1;
}

.field label {
    font-weight: 600;
}

.form-input,
.form-select {
    width: 100%;
    min-height: 45px;
    padding: 11px 13px;
    border: 1px solid #dfe3e8;
    border-radius: 7px;
    outline: none;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px #fff0eb;
}

.form-input::placeholder {
    color: #7a8492;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 15px;
}

.data-table th,
.data-table td {
    padding: 18px 25px;
    border-bottom: 1px solid #f0f1f3;
}

.data-table th {
    padding-top: 14px;
    padding-bottom: 14px;
    color: var(--muted);
    background: #fcfcfd;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.data-table td {
    height: 65px;
    white-space: nowrap;
}

.data-table td.text-muted {
    font-size: 13px;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: #fffdfc;
}

.table-primary {
    font-weight: 600;
}

#key-list td:nth-child(3) {
    font-weight: 600;
}

.api-key-value {
    color: #46505e;
    font-family: Consolas, "SFMono-Regular", monospace;
    font-size: 13px;
}

.action-link {
    padding: 0;
    border: 0;
    color: #d65b46;
    background: transparent;
    font: inherit;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge-success {
    color: #319472;
    background: #edf8f2;
}

.status-badge-danger {
    color: #d04d44;
    background: #fff0ed;
}

.status-badge-warning {
    color: #b7802a;
    background: #fff7e8;
}

.status-badge-neutral {
    color: #737d89;
    background: #f2f4f6;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.cloud-empty {
    height: 260px;
    color: #788392;
    text-align: center;
    vertical-align: middle;
}

div.cloud-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pager-meta,
.pager-summary {
    color: var(--muted);
    font-size: 13px;
}

.pager-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pager-button {
    height: 34px;
    padding: 0 13px;
    font-size: 13px;
}

.dashboard-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 166px;
    margin-bottom: 25px;
    padding: 28px 32px;
    border: 1px solid #f8e7df;
    border-radius: 12px;
    background: #fff2ec;
}

.dashboard-welcome h1 {
    font-size: 36px;
    font-weight: 700;
}

#dashboard-greeting-text {
    margin-top: 9px;
    color: #75645e;
    font-size: 15px;
}

.dashboard-actions {
    display: flex;
    gap: 12px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

.dashboard-panel {
    min-width: 0;
}

.dashboard-heading-icon {
    display: inline-flex;
    color: #a0a5ad;
}

.dashboard-heading-icon .icon {
    width: 18px;
    height: 18px;
}

.dashboard-panel-list {
    min-height: 260px;
    padding: 0 24px;
}

.dashboard-list-item {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    min-height: 67px;
    padding: 14px 0;
    border: 0;
    border-bottom: 1px solid #f1f2f4;
    color: var(--ink);
    background: transparent;
    font: inherit;
    text-align: left;
}

.dashboard-list-item:last-child {
    border-bottom: 0;
}

.dashboard-announcement > .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #b5bac2;
}

.dashboard-item-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.dashboard-item-title {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

#user-ranking-list .dashboard-item-title {
    display: block;
    white-space: nowrap;
}

.dashboard-item-time {
    margin-top: 4px;
    color: #788392;
    font-size: 12px;
}

.dashboard-rank,
.dashboard-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #657182;
    background: #f5f6f8;
    font-size: 12px;
    font-weight: 600;
}

.dashboard-rank.top {
    color: var(--accent);
    background: #fff0eb;
}

.dashboard-avatar .icon {
    width: 15px;
    height: 15px;
}

.dashboard-value {
    flex-shrink: 0;
    color: #46505e;
    font-size: 14px;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 25px;
}

.stat-card {
    padding: 25px 30px;
}

.stat-label {
    color: #505b6b;
    font-size: 15px;
}

.stat-value {
    margin: 9px 0 4px;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.4;
}

.stat-note {
    color: #788392;
    font-size: 13px;
}

.member-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 0 30px;
}

.member-intro h1 {
    margin-bottom: 10px;
    font-size: 26px;
    font-weight: 700;
}

.member-current {
    display: flex;
    align-items: center;
    gap: 14px;
}

.member-current-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13px;
}

.member-plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.member-plan-grid > .cloud-empty {
    grid-column: 1 / -1;
}

.member-plan {
    display: flex;
    flex-direction: column;
    min-height: 414px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.member-plan-featured {
    border-color: #ffc4b1;
    background: #fff9f6;
}

.member-plan-heading h2 {
    font-size: 20px;
    font-weight: 700;
}

.member-plan-price {
    margin-top: 26px;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1.2;
}

.member-plan-period {
    margin-top: 8px;
    color: #788392;
    font-size: 13px;
}

.member-description-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 26px 0 30px;
    padding: 23px 0 0;
    border-top: 1px solid var(--line);
    list-style: none;
}

.member-description-list li {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #505b6b;
    font-size: 15px;
}

.member-description-list .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--accent);
}

.member-plan-actions {
    margin-top: auto;
}

.member-plan-actions .button {
    width: 100%;
}

.member-purchase-price {
    font-size: 30px;
    font-weight: 700;
}

.member-duration-select {
    position: relative;
}

.member-duration-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 45px;
    padding: 11px 13px;
    border: 1px solid #dfe3e8;
    border-radius: 7px;
    color: var(--ink);
    background: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s;
}

.member-duration-trigger:hover {
    border-color: #c2c8d0;
}

.member-duration-trigger:focus-visible,
.member-duration-trigger[aria-expanded="true"] {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px #fff0eb;
}

.member-duration-chevron {
    width: 7px;
    height: 7px;
    margin-right: 3px;
    border-right: 1.5px solid #8b94a2;
    border-bottom: 1.5px solid #8b94a2;
    transform: rotate(45deg);
    transition: transform .18s;
}

.member-duration-trigger[aria-expanded="true"] .member-duration-chevron {
    transform: rotate(225deg);
}

.member-duration-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 6px);
    left: 0;
    z-index: 2;
    padding: 5px;
    border: 1px solid #dfe3e8;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 8px 24px #252b3414;
}

.member-duration-option {
    display: block;
    width: 100%;
    padding: 10px 11px;
    border: 0;
    border-radius: 5px;
    color: var(--ink);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.member-duration-option:hover,
.member-duration-option:focus-visible {
    outline: none;
    background: #f6f7f8;
}

.member-duration-option[aria-selected="true"] {
    color: var(--accent);
    background: #fff0eb;
}

.member-payment-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cloud-dialog {
    width: 480px;
    max-width: calc(100vw - 80px);
    max-height: calc(100vh - 80px);
    margin: auto;
    padding: 0;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 20px 80px #252b3424;
}

.cloud-dialog::backdrop {
    background: #24283266;
}

.cloud-dialog[open] {
    animation: cloud-dialog-in .22s ease-out;
}

.cloud-dialog[open]::backdrop {
    animation: cloud-backdrop-in .22s ease-out;
}

.cloud-dialog.is-closing {
    animation: cloud-dialog-out .18s ease-in forwards;
}

.cloud-dialog.is-closing::backdrop {
    animation: cloud-backdrop-out .18s ease-in forwards;
}

@keyframes cloud-dialog-in {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cloud-dialog-out {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(8px) scale(.98); }
}

@keyframes cloud-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes cloud-backdrop-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    #order-filters::before,
    #order-filters .button,
    .order-table-wrap {
        transition: none;
    }
}

.dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px 20px;
    border-bottom: 1px solid #f0f1f3;
}

.dialog-heading h2,
.dialog-heading h3 {
    padding-top: 3px;
    font-size: 19px;
    font-weight: 700;
}

.dialog-heading p {
    margin-top: 9px;
    font-size: 13px;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    color: #9a9fa8;
    background: transparent;
    font-size: 24px;
    line-height: 1;
}

.icon-button:hover {
    color: var(--ink);
    background: #f5f6f8;
}

.icon-button .icon {
    width: 17px;
    height: 17px;
}

.dialog-content {
    padding: 25px 28px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 28px;
    border-top: 1px solid #f0f1f3;
}

.dialog-note {
    font-size: 13px;
}

.dialog-error:not(:empty) {
    margin-top: 12px;
    font-size: 13px;
}

#announcement-modal {
    width: 720px;
}

.announcement-content {
    white-space: pre-wrap;
    line-height: 1.9;
}

.pay-dialog {
    width: 370px;
}

.pay-dialog .dialog-content {
    text-align: center;
}

.pay-modal-qr {
    width: 250px;
    height: 250px;
    object-fit: contain;
}

.contact-service-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 18px;
    border-radius: 8px;
    background: #faf9f8;
}

.contact-service-item + .contact-service-item {
    margin-top: 12px;
}

.contact-service-item strong {
    font-size: 17px;
    font-weight: 600;
}

.cloud-toast {
    position: fixed;
    inset: 24px 24px auto auto;
    z-index: 100;
    display: none;
    align-items: center;
    gap: 12px;
    max-width: 480px;
    margin: 0;
    padding: 12px 15px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink);
    background: #fff;
    font-size: 14px;
    box-shadow: 0 8px 30px #252b3414;
}

.cloud-toast:popover-open {
    display: flex;
}

.cloud-toast.is-visible {
    display: flex;
}

.cloud-dialog > .cloud-toast.is-visible {
    position: sticky;
    inset: 12px auto auto;
    width: calc(100% - 24px);
    max-width: none;
    margin: 12px;
}

.cloud-toast > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.cloud-toast-success > .icon {
    color: #319472;
}

.cloud-toast-error > .icon {
    color: #d04d44;
}

.cloud-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: cloud-spin .7s linear infinite;
}

@keyframes cloud-spin {
    to { transform: rotate(360deg); }
}

.calls-filter-card {
    position: relative;
    overflow: visible;
    margin-bottom: 24px;
    padding: 22px 25px;
}

.calls-filter-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.calls-range-options {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid #eff0f2;
    border-radius: 8px;
    background: #fafafa;
}

.calls-range-button {
    height: 34px;
    padding: 0 15px;
    border: 0;
    border-radius: 5px;
    color: #657182;
    background: transparent;
    font-size: 14px;
}

.calls-range-button:hover {
    color: var(--accent);
}

.calls-range-button.is-active {
    color: var(--accent);
    background: #fff;
    font-weight: 600;
    box-shadow: 0 1px 5px #252b340d;
}

.calls-filter-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 20px 0 0;
}

.calls-filter-field {
    min-width: 0;
}

.calls-filter-field label {
    display: block;
    margin-bottom: 8px;
    color: #505b6b;
    font-size: 13px;
    font-weight: 600;
}

.calls-filter-field .form-input,
.calls-filter-field .form-select {
    min-height: 40px;
    padding: 8px 11px;
    font-size: 15px;
}

.calls-panel,
.calls-ranking-grid,
.calls-activity-grid {
    margin-bottom: 24px;
}

.calls-date-picker {
    position: relative;
}

.calls-filter-field .calls-date-input {
    padding-right: 43px;
    cursor: pointer;
}

.calls-date-trigger {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    padding: 0;
    border: 0;
    border-radius: 0 6px 6px 0;
    color: #8b94a2;
    background: transparent;
}

.calls-date-trigger:hover {
    color: var(--accent);
}

.calls-calendar {
    position: absolute;
    z-index: 35;
    width: 280px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 12px 36px #252b341a;
}

.calls-calendar[hidden] {
    display: none;
}

.calls-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.calls-calendar-header strong {
    font-size: 14px;
    font-weight: 600;
}

.calls-calendar-header button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    color: #727b89;
    background: transparent;
}

.calls-calendar-header .icon {
    width: 16px;
    height: 16px;
}

.calls-calendar-weekdays,
.calls-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.calls-calendar-weekdays {
    margin-bottom: 7px;
    color: #788392;
    font-size: 12px;
    text-align: center;
}

.calls-calendar-day {
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    color: #46505e;
    background: transparent;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.calls-calendar-header button:hover,
.calls-calendar-day:hover:not(:disabled) {
    color: var(--accent);
    background: #fff0eb;
}

.calls-calendar-day.is-today {
    color: var(--accent);
    font-weight: 600;
}

.calls-calendar-day.is-selected,
.calls-calendar-day.is-selected:hover {
    color: #fff;
    background: var(--accent);
}

.calls-calendar-day:disabled,
.calls-calendar-header button:disabled {
    color: #cbd0d7;
    background: transparent;
    cursor: default;
}

.calls-calendar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f0f1f3;
}

.calls-calendar-footer button {
    padding: 3px 6px;
    border: 0;
    border-radius: 4px;
    color: #657182;
    background: transparent;
    font-size: 13px;
}

.calls-calendar-footer button:hover {
    color: var(--accent);
}

.calls-calendar-footer button:disabled {
    color: #cbd0d7;
    cursor: default;
}

.calls-activity-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    align-items: stretch;
    gap: 24px;
}

.calls-overview-panel,
.calls-detail-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.calls-detail-panel .table-footer {
    margin-top: auto;
}

.calls-overview {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 24px 25px;
}

.calls-overview > .calls-panel-empty {
    flex: 1;
}

.calls-overview-total {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.calls-overview-total > strong {
    color: var(--accent);
    font-size: 46px;
    font-weight: 700;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.calls-overview-unit {
    margin-left: 5px;
    color: var(--muted);
    font-size: 13px;
}

.calls-overview-range {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.calls-overview-metrics {
    display: grid;
    flex: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 228px;
    margin-top: 24px;
    border-top: 1px solid var(--line);
}

.calls-overview-metric {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
}

.calls-overview-metric:nth-child(even) {
    padding-left: 24px;
}

.calls-overview-metric > span {
    color: var(--muted);
    font-size: 13px;
}

.calls-overview-metric strong {
    font-size: 24px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.calls-overview-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
}

.calls-overview-record {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.calls-overview-record > span {
    flex-shrink: 0;
    color: var(--muted);
}

.calls-overview-record > strong {
    font-weight: 600;
    text-align: right;
}

.calls-detail-panel .data-table th,
.calls-detail-panel .data-table td {
    padding-right: 14px;
    padding-left: 14px;
}

.calls-detail-panel .api-key-value {
    display: block;
    max-width: 150px;
    overflow-wrap: anywhere;
    white-space: normal;
}

.calls-detail-panel .data-table td:last-child {
    min-width: 108px;
    white-space: normal;
}

.calls-chart-legend {
    display: flex;
    align-items: center;
    gap: 22px;
    color: #657182;
    font-size: 13px;
    white-space: nowrap;
}

.calls-chart-legend span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.calls-legend-current,
.calls-legend-previous {
    display: block;
    width: 22px;
    height: 0;
    border-top: 2px solid #ff7657;
}

.calls-legend-previous {
    border-top-color: #b8c0cb;
    border-top-style: dashed;
}

.calls-trend {
    min-height: 300px;
    padding: 22px 25px 12px;
}

.calls-trend-shell {
    position: relative;
    min-height: 250px;
}

.calls-trend-svg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 250px;
    overflow: visible;
}

.calls-trend-grid {
    stroke: #eef0f3;
    stroke-width: 1;
}

.calls-trend-axis {
    fill: #788392;
    font-family: inherit;
    font-size: 12px;
}

.calls-trend-current {
    fill: none;
    stroke: #ff7657;
    stroke-width: 2.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.calls-trend-previous {
    fill: none;
    stroke: #b8c0cb;
    stroke-width: 2;
    stroke-dasharray: 5 5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.calls-trend-point {
    fill: transparent;
    stroke: transparent;
    cursor: default;
}

.calls-trend-point:hover,
.calls-trend-point:focus-visible {
    fill: #ff765726;
    stroke: #ff7657;
    outline: none;
}

.calls-chart-tooltip {
    position: absolute;
    z-index: 2;
    max-width: 230px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #505b6b;
    background: #fff;
    font-size: 13px;
    box-shadow: 0 6px 22px #252b3414;
    pointer-events: none;
}

.calls-chart-tooltip[hidden] {
    display: none;
}

.calls-panel-note {
    padding: 0 25px 20px;
    color: #788392;
    font-size: 13px;
}

.calls-panel-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    color: #788392;
    font-size: 14px;
}

.calls-ranking-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.calls-ranking-panel {
    min-width: 0;
}

.calls-ranking {
    padding: 5px 25px 12px;
}

.calls-ranking-list {
    max-height: 360px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.calls-ranking-item {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    padding: 17px 0;
    border: 0;
    border-bottom: 1px solid #f0f1f3;
    color: var(--ink);
    background: transparent;
    font: inherit;
    text-align: left;
}

.calls-ranking-item:last-child {
    border-bottom: 0;
}

.calls-ranking-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 27px;
    width: 27px;
    height: 27px;
    border-radius: 7px;
    color: #657182;
    background: #f5f6f8;
    font-size: 12px;
    font-weight: 600;
}

.calls-ranking-item:nth-child(-n+3) .calls-ranking-index,
.calls-ranking-index.top {
    color: var(--accent);
    background: #fff0eb;
}

.calls-ranking-main {
    flex: 1;
    min-width: 0;
}

.calls-ranking-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

.calls-ranking-name {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.calls-ranking-value {
    flex-shrink: 0;
    color: #46505e;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.calls-ranking-track {
    display: block;
    height: 5px;
    overflow: hidden;
    border-radius: 5px;
    background: #fff2ec;
}

.calls-ranking-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #ff9c7e;
}

.calls-ranking-note {
    display: block;
    margin-top: 7px;
    color: #788392;
    font-size: 12px;
}

.cloud-menu-toggle,
.cloud-sidebar-close,
.cloud-sidebar-overlay {
    display: none;
}

@media (max-width: 1024px) {
    body.cloud-menu-open {
        overflow: hidden;
    }

    #sidebar {
        z-index: 51;
        width: 280px;
        max-width: calc(100vw - 48px);
        visibility: hidden;
        transform: translateX(-100%);
        transition: transform .22s ease, visibility .22s;
        overscroll-behavior: contain;
    }

    body.cloud-menu-open #sidebar {
        visibility: visible;
        transform: translateX(0);
        transition-property: transform;
    }

    .cloud-brand {
        height: 76px;
        padding-right: 52px;
        padding-left: 20px;
    }

    .cloud-brand-title {
        font-size: 18px;
    }

    .cloud-sidebar-close {
        position: absolute;
        top: 16px;
        right: 10px;
        display: inline-flex;
        width: 44px;
        height: 44px;
    }

    .cloud-sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 50;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        background: #24283266;
        transition: opacity .22s ease, visibility .22s;
    }

    body.cloud-menu-open .cloud-sidebar-overlay {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    .cloud-menu-toggle {
        display: inline-flex;
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        color: #46505e;
    }

    .cloud-menu-toggle .icon {
        width: 22px;
        height: 22px;
    }

    #page-header {
        left: 0;
    }

    .content-header {
        gap: 12px;
        padding: 0 20px;
    }

    .header-title-wrap {
        flex: 1;
        min-width: 0;
    }

    .content-header [data-logout] {
        flex-shrink: 0;
    }

    #main-container {
        margin-left: 0;
    }

    .content {
        padding: 24px;
    }

    .button,
    .button-small,
    .icon-button {
        min-height: 44px;
    }

    .form-input,
    .form-select,
    .calls-filter-field .form-input,
    .calls-filter-field .form-select,
    .member-duration-trigger {
        min-height: 46px;
        font-size: 16px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-welcome {
        flex-wrap: wrap;
    }

    .member-intro {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .member-current {
        flex-wrap: wrap;
    }

    .member-plan {
        min-width: 0;
        padding: 24px;
    }

    .member-description-list li {
        align-items: flex-start;
    }

    .member-description-list .icon {
        margin-top: 4px;
    }

    .calls-filter-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calls-activity-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .table-wrap {
        min-width: 0;
        max-width: 100%;
        overscroll-behavior-x: contain;
    }

    body[data-page="orders"] .data-table {
        min-width: 1040px;
    }

    body[data-page="keys"] .data-table {
        min-width: 690px;
    }

    .calls-detail-panel .data-table {
        min-width: 620px;
    }
}

@media (max-width: 768px) {
    .member-plan-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .member-plan {
        min-height: 0;
    }

    .member-plan-price {
        margin-top: 18px;
    }

    .member-description-list {
        margin-top: 20px;
        margin-bottom: 24px;
    }

    .member-description-list li {
        align-items: center;
    }

    .member-description-list .icon {
        margin-top: 0;
    }
}

@media (max-width: 640px) {
    .content-header {
        gap: 8px;
        padding: 0 12px;
    }

    .content-header [data-logout] {
        min-width: 0;
        height: 44px;
        padding: 0 14px;
    }

    .content {
        padding: 16px;
    }

    .page-card,
    .dashboard-welcome,
    .member-plan {
        border-radius: 10px;
    }

    .card-heading {
        flex-wrap: wrap;
        gap: 12px;
        min-height: 66px;
        padding: 16px;
    }

    .card-heading > div {
        min-width: 0;
    }

    .card-heading p,
    .dialog-heading h2,
    .dialog-heading h3,
    .announcement-content {
        overflow-wrap: anywhere;
    }

    .card-content,
    .table-footer {
        padding: 16px;
    }

    .icon-button {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
    }

    .action-link {
        min-height: 44px;
        padding: 8px 4px;
    }

    .data-table th,
    .data-table td {
        padding: 14px 16px;
    }

    .data-table {
        font-size: 14px;
    }

    .pager {
        flex-wrap: wrap;
        gap: 12px;
    }

    .pager-actions {
        flex-shrink: 0;
        gap: 8px;
        margin-left: auto;
    }

    .pager-button {
        min-height: 44px;
        padding: 0 12px;
    }

    .pager-summary {
        min-width: 40px;
        text-align: center;
        white-space: nowrap;
    }

    #order-filters {
        width: 100%;
    }

    #order-filters .button {
        padding: 0 12px;
    }

    .dashboard-welcome {
        align-items: flex-start;
        gap: 20px;
        margin-bottom: 16px;
        padding: 24px 20px;
    }

    .dashboard-welcome h1 {
        font-size: 30px;
    }

    .dashboard-actions {
        width: 100%;
        gap: 10px;
    }

    .dashboard-actions .button {
        flex: 1;
        gap: 8px;
        padding: 0 10px;
    }

    .dashboard-grid,
    .stats-grid,
    .calls-ranking-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .dashboard-panel-list {
        min-height: 0;
        padding: 0 16px;
    }

    .dashboard-item-title {
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .dashboard-list-item {
        gap: 10px;
    }

    .dashboard-value {
        font-size: 13px;
    }

    .member-intro {
        gap: 16px;
        padding-top: 8px;
        padding-bottom: 24px;
    }

    .member-intro h1 {
        font-size: 23px;
    }

    .member-plan {
        padding: 24px 20px;
    }

    .calls-filter-card {
        padding: 16px;
    }

    .calls-filter-top,
    .calls-range-options {
        width: 100%;
    }

    .calls-range-options {
        gap: 2px;
    }

    .calls-range-button {
        flex: 1;
        min-height: 44px;
        padding: 0 3px;
        font-size: 13px;
        white-space: nowrap;
    }

    .calls-filter-fields {
        gap: 16px 12px;
    }

    .calls-filter-field:nth-child(-n+2) {
        grid-column: 1 / -1;
    }

    .calls-date-trigger {
        width: 44px;
    }

    .calls-filter-field .calls-date-input {
        padding-right: 48px;
    }

    .calls-calendar {
        width: 340px;
        max-width: calc(100% - 32px);
        padding: 12px;
    }

    .calls-calendar-header button,
    .calls-calendar-day {
        width: 100%;
        min-height: 40px;
    }

    .calls-calendar-header button {
        width: 40px;
    }

    .calls-calendar-days,
    .calls-calendar-weekdays {
        gap: 2px;
    }

    .calls-calendar-day {
        font-size: 14px;
    }

    .calls-calendar-footer button {
        min-height: 44px;
        padding: 6px 10px;
    }

    .calls-panel,
    .calls-filter-card,
    .calls-ranking-grid,
    .calls-activity-grid {
        margin-bottom: 16px;
    }

    .calls-ranking,
    .calls-overview {
        padding-right: 16px;
        padding-left: 16px;
    }

    .calls-ranking-meta {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 4px 8px;
    }

    .calls-ranking-name {
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .calls-ranking-note {
        overflow-wrap: anywhere;
    }

    .calls-overview-total > strong {
        font-size: 38px;
    }

    .calls-overview-metric:nth-child(even) {
        padding-left: 16px;
    }

    .calls-overview-metric strong {
        font-size: 22px;
    }

    .calls-overview-record {
        flex-wrap: wrap;
        gap: 4px 12px;
    }

    .calls-overview-record > strong {
        overflow-wrap: anywhere;
    }

    .calls-chart-legend {
        flex-wrap: wrap;
        gap: 16px;
    }

    .calls-trend {
        min-height: 260px;
        padding: 16px 16px 8px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
    }

    .calls-trend-shell {
        min-width: 720px;
    }

    .calls-trend-axis {
        font-size: 17px;
    }

    .calls-panel-note {
        padding: 0 16px 16px;
    }

    body[data-page="status"] .data-table th,
    body[data-page="status"] .data-table td {
        padding: 14px 10px;
    }

    body[data-page="status"] .data-table td:first-child {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    body[data-page="status"] .data-table th {
        font-size: 12px;
    }

    body[data-page="status"] .status-badge {
        gap: 5px;
        padding-right: 7px;
        padding-left: 7px;
        font-size: 12px;
    }

    .cloud-dialog {
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
        overscroll-behavior: contain;
    }

    .dialog-heading {
        align-items: center;
        gap: 12px;
        padding: 16px 20px;
    }

    .dialog-heading h2,
    .dialog-heading h3 {
        padding-top: 0;
        font-size: 18px;
    }

    .dialog-content {
        padding: 20px;
    }

    .dialog-actions {
        flex-wrap: wrap;
        padding: 16px 20px;
    }

    .dialog-actions .button {
        flex: 1;
    }

    .member-duration-option {
        min-height: 44px;
        font-size: 16px;
    }

    .member-payment-options {
        gap: 10px;
    }

    .member-payment-options .button {
        padding: 0 12px;
        font-size: 14px;
    }

    .pay-modal-qr {
        max-width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .contact-service-item {
        flex-wrap: wrap;
        gap: 4px 12px;
        padding: 14px;
    }

    .cloud-toast {
        inset: 12px 12px auto;
        gap: 8px;
        width: auto;
        max-width: none;
        padding: 10px 12px;
    }

    .cloud-toast > span {
        flex: 1;
        min-width: 0;
        overflow-wrap: anywhere;
    }
}

@media (prefers-reduced-motion: reduce) {
    #sidebar,
    .cloud-sidebar-overlay {
        transition: none;
    }
}

@media (max-width: 1199.98px) {
    .calls-trend {
        overflow-x: auto;
        overscroll-behavior-x: contain;
    }

    .calls-trend-shell {
        min-width: 720px;
    }

    .calls-trend-axis {
        font-size: 17px;
    }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    .calls-trend-axis {
        font-size: 14px;
    }
}

body .data-table.is-load-error {
    min-width: 0;
}

.data-table.is-load-error thead {
    display: none;
}

/* ---------- 管理中心（管理员） ---------- */
.admin-empty {
    padding: 36px 16px;
    text-align: center;
    color: #dc4b4b;
    font-weight: 600;
}

body[data-page="admin"] .admin-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 30px 0 15px;
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

body[data-page="admin"] .admin-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #eef0f3;
}

body[data-page="admin"] #admin-stats-grid {
    grid-template-columns: repeat(4, 1fr);
}

body[data-page="admin"] #admin-stats-grid-2 {
    grid-template-columns: repeat(3, 1fr);
}

.admin-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 6px;
}

.admin-settings-grid .page-card {
    min-width: 0;
}

.admin-form {
    display: grid;
    gap: 14px;
    padding: 24px 25px 26px;
}

.admin-field-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 6px 16px;
    align-items: center;
}

.admin-field-row > label {
    font-size: 14px;
    font-weight: 500;
    color: #505b6b;
    white-space: nowrap;
}

.admin-field {
    display: grid;
    gap: 8px;
}

.admin-field > label {
    font-size: 14px;
    font-weight: 500;
    color: #505b6b;
}

.admin-form .form-input {
    width: 100%;
    box-sizing: border-box;
}

.admin-logo-input {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-logo-input .form-input {
    flex: 1 1 220px;
    min-width: 0;
}

.admin-logo-preview {
    min-height: 58px;
    display: flex;
    align-items: center;
}

.admin-logo-preview img {
    width: 48px;
    height: 48px;
    padding: 5px;
    border: 1px solid #eef1f6;
    border-radius: 9px;
    background: #fff;
    object-fit: contain;
}

.admin-form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
}

.admin-tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 6px;
}

.admin-tables-grid .page-card {
    min-width: 0;
}

.admin-tables-grid .page-card:nth-child(3) {
    grid-column: 1 / -1;
}

body[data-page="admin"] .data-table .button-small {
    height: 31px;
    padding: 0 12px;
    font-size: 13px;
    line-height: 1;
}

body[data-page="admin"] .admin-row-actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

body[data-page="admin"] .button.button-danger {
    color: #dc4b4b;
    border-color: rgba(220, 75, 75, .45);
    background: transparent;
}

body[data-page="admin"] .button.button-danger:hover {
    background: rgba(220, 75, 75, .08);
}

#admin-order-detail-body .order-detail-grid {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px 12px;
    font-size: 14px;
}

#admin-order-detail-body .order-detail-grid .detail-key {
    color: #6b7280;
    word-break: keep-all;
}

#admin-order-detail-body .order-detail-grid .detail-value {
    color: #1f2937;
    word-break: break-all;
}

@media (max-width: 1200px) {
    body[data-page="admin"] #admin-stats-grid,
    body[data-page="admin"] #admin-stats-grid-2 {
        grid-template-columns: 1fr 1fr;
    }

    .admin-settings-grid,
    .admin-tables-grid {
        grid-template-columns: 1fr;
    }

    .admin-tables-grid .page-card:nth-child(3) {
        grid-column: auto;
    }
}

