* { box-sizing: border-box; }

body.page {
    margin: 0;
    min-height: 100vh;
    color: #1f2a37;
    background: #f4f7fb;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.shell {
    width: min(880px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 64px;
}

.card {
    width: min(420px, calc(100% - 32px));
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e6ebf2;
    border-radius: 16px;
    padding: 32px 28px 28px;
    box-shadow: 0 12px 32px rgba(22, 48, 92, 0.06);
}

.shell > .card {
    width: 100%;
    margin-top: 8px;
}

.brand {
    margin: 0 0 8px;
    color: #1677ff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.3;
}

.lead {
    margin: 10px 0 0;
    color: #667085;
    font-size: 14px;
    line-height: 1.6;
}

form {
    margin-top: 22px;
}

label {
    display: block;
    margin: 14px 0 6px;
    color: #344054;
    font-size: 13px;
}

input {
    width: 100%;
    height: 42px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    padding: 0 12px;
    color: #1f2a37;
    font-size: 14px;
    background: #fff;
}

input:focus {
    outline: 2px solid rgba(22, 119, 255, 0.2);
    border-color: #1677ff;
}

button {
    width: 100%;
    height: 44px;
    margin-top: 18px;
    border: 0;
    border-radius: 10px;
    background: #1677ff;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

button:hover {
    background: #0f66e0;
}

.banner {
    margin: 14px 0 0;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
}

.banner-error {
    color: #b42318;
    background: #fef3f2;
}

.banner-ok {
    color: #067647;
    background: #ecfdf3;
}

/* 操作结果提示：顶部居中浮层，3 秒自动消失 */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    z-index: 9999;
    max-width: min(480px, calc(100% - 32px));
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.5;
    text-align: center;
    color: #fff;
    background: rgba(31, 42, 55, 0.92);
    box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.5);
    transform: translate(-50%, -20px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.toast.toast-show {
    transform: translate(-50%, 0);
    opacity: 1;
}

.toast.toast-error {
    background: rgba(180, 35, 24, 0.95);
}

.toast.toast-ok {
    background: rgba(6, 118, 71, 0.95);
}

.apps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0 18px;
}

.app {
    display: block;
    min-height: 92px;
    padding: 16px;
    color: inherit;
    text-decoration: none;
    background: #fff;
    border: 1px solid #e6ebf2;
    border-radius: 14px;
}

.app strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.app span {
    display: block;
    color: #667085;
    font-size: 12px;
    word-break: break-all;
}

.app:hover {
    border-color: #1677ff;
}

.foot {
    margin: 16px 0 0;
    text-align: right;
}

.foot a {
    color: #475467;
    font-size: 13px;
}

h2 {
    margin: 0;
    font-size: 16px;
}

.hint {
    margin: 8px 0 0;
    color: #667085;
    font-size: 13px;
    line-height: 1.6;
}

.btn-compact {
    width: auto;
    height: 40px;
    margin: 0;
    padding: 0 14px;
    white-space: nowrap;
}

.btn-ghost {
    background: #fff;
    color: #344054;
    border: 1px solid #d0d5dd;
}

.btn-ghost:hover {
    background: #f8fafc;
}

.bind-table {
    width: 100%;
    margin-top: 18px;
    border-collapse: collapse;
    font-size: 13px;
}

.bind-table th,
.bind-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #eef2f6;
}

.bind-table th {
    color: #667085;
    font-weight: 600;
}

.bind-table form {
    margin: 0;
}

/* ===== 登录页 ===== */
.page-login {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 32px 20px;
    background:
        radial-gradient(760px 420px at 12% -8%, #dbe8ff 0%, rgba(219, 232, 255, 0) 62%),
        radial-gradient(680px 400px at 104% 108%, #e3f1ff 0%, rgba(227, 241, 255, 0) 58%),
        linear-gradient(160deg, #f8faff 0%, #eef4ff 100%);
}

.page-login::before,
.page-login::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
}

.page-login::before {
    width: 420px;
    height: 420px;
    top: -190px;
    left: -140px;
    background: radial-gradient(circle, rgba(22, 119, 255, 0.14), rgba(22, 119, 255, 0));
}

.page-login::after {
    width: 360px;
    height: 360px;
    right: -130px;
    bottom: -170px;
    background: radial-gradient(circle, rgba(91, 157, 255, 0.16), rgba(91, 157, 255, 0));
}

.login-card {
    position: relative;
    z-index: 1;
    width: min(404px, 100%);
    padding: 34px 34px 26px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 22px;
    box-shadow:
        0 1px 2px rgba(16, 44, 92, 0.04),
        0 28px 60px -22px rgba(18, 64, 140, 0.32);
    backdrop-filter: blur(6px);
    animation: login-rise 0.45s ease-out both;
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 34px;
    right: 34px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, #2b7fff, #6fb0ff);
}

@keyframes login-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-head {
    display: flex;
    align-items: center;
    gap: 13px;
}

.login-logo {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 13px;
    background: linear-gradient(140deg, #2b7fff, #1668e3);
    box-shadow: 0 10px 20px -10px rgba(22, 104, 227, 0.9);
    color: #fff;
}

.login-logo svg {
    width: 23px;
    height: 23px;
}

.login-head .brand {
    margin: 0 0 3px;
    font-size: 12px;
    letter-spacing: 0.12em;
}

.login-card h1 {
    margin: 0;
    font-size: 22px;
    letter-spacing: 0.02em;
}

.login-form {
    margin-top: 20px;
}

.login-form label {
    margin: 16px 0 7px;
    color: #475467;
    font-size: 12.5px;
    font-weight: 500;
}

.login-form label:first-of-type {
    margin-top: 0;
}

.field {
    position: relative;
}

.field-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    fill: #98a2b3;
    pointer-events: none;
    transition: fill 0.15s ease;
}

.field input {
    height: 46px;
    padding: 0 14px 0 42px;
    border: 1px solid #e1e8f2;
    border-radius: 12px;
    background: #f9fbfe;
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.field input::placeholder {
    color: #a9b4c4;
}

.field input:focus {
    outline: none;
    border-color: #2b7fff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(43, 127, 255, 0.16);
}

.field:focus-within .field-icon {
    fill: #2b7fff;
}

.login-form .banner {
    margin: 14px 0 0;
}

.login-form button {
    height: 46px;
    margin-top: 22px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2b7fff, #1668e3);
    box-shadow: 0 12px 24px -12px rgba(22, 104, 227, 0.95);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.12em;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.login-form button:hover {
    background: linear-gradient(135deg, #2b7fff, #1668e3);
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 16px 28px -12px rgba(22, 104, 227, 0.95);
}

.login-form button:active {
    transform: translateY(0);
    box-shadow: 0 8px 16px -10px rgba(22, 104, 227, 0.95);
}

.login-foot {
    margin: 22px 0 0;
    color: #a3adbd;
    font-size: 11.5px;
    text-align: center;
    letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
    .login-card {
        animation: none;
    }
}

/* ===== 应用入口 ===== */
.page-portal {
    padding-bottom: 48px;
    background: linear-gradient(180deg, #f6f9ff 0%, #f1f5fb 100%);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid #e8eef7;
    backdrop-filter: blur(10px);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1040px, calc(100% - 32px));
    height: 62px;
    margin: 0 auto;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1f2a37;
    text-decoration: none;
}

.topbar-logo {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(140deg, #2b7fff, #1668e3);
    box-shadow: 0 8px 16px -10px rgba(22, 104, 227, 0.9);
}

.topbar-logo svg {
    width: 18px;
    height: 18px;
}

.topbar-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.topbar-title em {
    margin-left: 6px;
    color: #2b7fff;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #1668e3;
    background: #e8f1ff;
    font-size: 13px;
    font-weight: 600;
}

.topbar-name {
    color: #344054;
    font-size: 13px;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    width: auto;
    height: auto;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid #e1e8f2;
    border-radius: 8px;
    color: #667085;
    background: #fff;
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.topbar-link:hover {
    color: #1668e3;
    border-color: #bcd3f7;
    background: #f5f9ff;
}

.page-portal .shell {
    width: min(1040px, calc(100% - 32px));
    padding: 34px 0 10px;
}

.hero {
    margin-bottom: 22px;
}

.hero h1 {
    margin: 0;
    font-size: 26px;
}

.hero .lead {
    margin: 8px 0 0;
    color: #667085;
    font-size: 13.5px;
    line-height: 1.7;
}

.section-title {
    margin: 28px 0 12px;
    color: #344054;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.page-portal .apps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 26px;
}

.page-portal .app {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 0;
    padding: 18px;
    border: 1px solid #e6ebf2;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 24px -20px rgba(18, 64, 140, 0.6);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.page-portal .app:hover {
    transform: translateY(-2px);
    border-color: #bcd3f7;
    box-shadow: 0 20px 32px -22px rgba(18, 64, 140, 0.65);
}

.app .app-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: #1668e3;
    background: linear-gradient(140deg, #eaf3ff, #dbe9ff);
    font-size: 17px;
    font-weight: 600;
    overflow: hidden;
}

.app .app-body {
    flex: 1;
    min-width: 0;
}

.app-body strong {
    display: block;
    margin-bottom: 5px;
    font-size: 15px;
}

.app .app-arrow {
    color: #b6c2d3;
    font-size: 16px;
    transition: transform 0.18s ease, color 0.18s ease;
}

.page-portal .app:hover .app-arrow {
    color: #2b7fff;
    transform: translateX(3px);
}

.page-portal .card {
    width: 100%;
    margin: 0 0 16px;
    padding: 22px 22px 20px;
    border-radius: 16px;
    box-shadow: 0 14px 30px -26px rgba(18, 64, 140, 0.6);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.card-head h2 {
    font-size: 15px;
}

.tag {
    padding: 3px 9px;
    border-radius: 999px;
    color: #1668e3;
    background: #eaf3ff;
    font-size: 11px;
}

.tag-admin {
    color: #b54708;
    background: #fff4e5;
}

.page-portal .btn-compact {
    height: 38px;
    padding: 0 16px;
    border-radius: 9px;
    background: linear-gradient(135deg, #2b7fff, #1668e3);
    box-shadow: 0 10px 18px -14px rgba(22, 104, 227, 0.9);
    font-size: 13px;
    font-weight: 500;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.page-portal .btn-compact:hover {
    background: linear-gradient(135deg, #2b7fff, #1668e3);
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.toolbar .btn-compact {
    height: 34px;
    padding: 0 14px;
    font-size: 12.5px;
    box-shadow: 0 8px 14px -12px rgba(22, 104, 227, 0.8);
}

.page-portal .btn-ghost {
    color: #475467;
    background: #fff;
    border: 1px solid #e1e8f2;
    box-shadow: none;
    transform: none;
}

.page-portal .btn-ghost:hover {
    color: #b42318;
    border-color: #f4c9c4;
    background: #fef6f5;
    filter: none;
    transform: none;
}

.page-portal .bind-table th {
    color: #98a2b3;
    font-size: 12px;
    font-weight: 500;
}

.page-portal .bind-table td {
    color: #344054;
    font-size: 13px;
}

.page-portal .bind-table tbody tr:hover {
    background: #f8fbff;
}

.cell-action {
    text-align: right;
}

.binding-input {
    width: 180px;
    padding: 6px 10px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}

.binding-input:focus {
    border-color: #1677ff;
}

/* 平台卡片图标 */
.page-portal .app {
    padding: 20px;
}

.page-portal .app-body strong {
    margin-bottom: 0;
    font-size: 16px;
}

.app .app-icon svg {
    display: block;
    width: 28px;
    height: 28px;
}

.page-portal .app-icon.icon-erp {
    color: #1668e3;
    background: linear-gradient(140deg, #eaf3ff, #d7e7ff);
}

.page-portal .app-icon.icon-iot {
    color: #067647;
    background: linear-gradient(140deg, #e9f9f1, #cff0e0);
}

.page-portal .app-icon.icon-sms {
    color: #b54708;
    background: linear-gradient(140deg, #fff4e5, #ffe2bd);
}

.page-portal .app-icon:not(.icon-erp):not(.icon-iot):not(.icon-sms) {
    color: #475467;
    background: linear-gradient(140deg, #f4f6fa, #e7ebf2);
}

.app-arrow svg {
    display: block;
    width: 18px;
    height: 18px;
}

/* 顶部操作按钮 */
.topbar-link {
    width: auto;
    box-shadow: none;
    font-family: inherit;
    cursor: pointer;
}

.topbar-exit {
    color: #b42318;
    border-color: #f4d5d1;
}

.topbar-exit:hover {
    color: #912018;
    border-color: #eab3ac;
    background: #fef6f5;
}

/* 账号管理工具栏 */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.search-form {
    display: flex;
    gap: 8px;
    margin: 0;
}

.search-form input {
    width: 220px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid #e1e8f2;
    border-radius: 9px;
    background: #f9fbfe;
    font-size: 13px;
}

.search-form input:focus {
    outline: none;
    border-color: #2b7fff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(43, 127, 255, 0.16);
}

.btn-add {
    margin-left: auto;
}

.table-wrap {
    margin-top: 16px;
    overflow-x: auto;
}

.user-table {
    min-width: 620px;
}

.user-table th {
    padding: 10px 12px;
}

.user-table td {
    padding: 12px;
}

.cell-strong {
    color: #1f2a37;
    font-weight: 600;
}

.inline-form {
    display: inline;
    margin: 0;
}

.link-btn {
    width: auto;
    height: auto;
    padding: 0 6px;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: #1668e3;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
}

.link-btn:hover {
    color: #0f52b8;
    background: none;
    text-decoration: underline;
    transform: none;
    filter: none;
}

.link-danger {
    color: #b42318;
}

.link-danger:hover {
    color: #912018;
}

.chip {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
}

.chip-on {
    color: #067647;
    background: #e7f6ee;
}

.chip-off {
    color: #667085;
    background: #f0f2f5;
}

.empty {
    margin: 18px 0 4px;
    color: #98a2b3;
    font-size: 13px;
    text-align: center;
}

/* 分页 */
.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eef2f7;
}

.pager-info {
    color: #8a94a6;
    font-size: 12.5px;
}

.pager-btns {
    display: flex;
    gap: 8px;
}

.pager-btn {
    padding: 7px 14px;
    border: 1px solid #e1e8f2;
    border-radius: 8px;
    color: #475467;
    background: #fff;
    font-size: 12.5px;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.pager-btn:hover {
    color: #1668e3;
    border-color: #bcd3f7;
    background: #f5f9ff;
}

.pager-btn.is-disabled {
    pointer-events: none;
    color: #c4cbd6;
    background: #f7f9fc;
}

/* 弹窗 */
.modal {
    width: min(420px, calc(100% - 32px));
    padding: 0;
    border: none;
    border-radius: 18px;
    box-shadow: 0 30px 60px -20px rgba(15, 40, 90, 0.35);
}

.modal::backdrop {
    background: rgba(15, 23, 42, 0.42);
}

.modal-body {
    padding: 22px 22px 20px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-head h3 {
    margin: 0;
    color: #1f2a37;
    font-size: 17px;
}

.modal-close {
    width: auto;
    height: auto;
    padding: 0 4px;
    border: none;
    background: none;
    box-shadow: none;
    color: #98a2b3;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    color: #475467;
    background: none;
}

.modal-field {
    display: block;
    margin: 0 0 12px;
    color: #475467;
    font-size: 12.5px;
}

.modal-field input,
.modal-field select {
    display: block;
    width: 100%;
    height: 40px;
    margin-top: 6px;
    padding: 0 12px;
    border: 1px solid #e1e8f2;
    border-radius: 9px;
    background: #f9fbfe;
    color: #1f2a37;
    font-family: inherit;
    font-size: 13.5px;
}

.modal-field input:focus,
.modal-field select:focus {
    outline: none;
    border-color: #2b7fff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(43, 127, 255, 0.16);
}

.modal-field input[readonly] {
    color: #667085;
    background: #f2f4f8;
}

.modal-tip {
    margin: 10px 0 0;
    color: #8a94a6;
    font-size: 12px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.modal-actions .btn-compact {
    width: auto;
}

@media (max-width: 720px) {
    .apps {
        grid-template-columns: 1fr;
    }

    .shell {
        padding-top: 24px;
    }

    .login-card {
        padding: 28px 22px 22px;
        border-radius: 18px;
    }

    .login-card::before {
        left: 22px;
        right: 22px;
    }

    .login-card h1 {
        font-size: 20px;
    }

    .topbar-name {
        display: none;
    }

    .page-portal .shell {
        padding-top: 24px;
    }

    .hero h1 {
        font-size: 22px;
    }

    .page-portal .apps {
        grid-template-columns: 1fr;
    }

    .page-portal .btn-compact {
        width: 100%;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form input {
        flex: 1;
        width: auto;
    }

    .btn-add {
        margin-left: 0;
    }

    .pager {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-actions .btn-compact {
        width: auto;
    }
}
