:root {
    /* 医药 · 灰白色 clinical palette */
    --bg: #e8ecef;
    --bg-soft: #f4f6f8;
    --card: #ffffff;
    --card-border: #d4dade;
    --text: #2a3140;
    --text-muted: #5c6573;
    --primary: #1a7a7a;
    --primary-2: #269090;
    --primary-soft: rgba(26, 122, 122, 0.12);
    --success: #2a8f5a;
    --warning: #b8922e;
    --danger: #c4565c;
    --shadow: 0 16px 48px rgba(42, 70, 82, 0.1);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

/* 滚动条（浅色） */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #e4e8ec;
}

::-webkit-scrollbar-thumb {
    background: #b8c2cc;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9aa8b4;
}

* {
    box-sizing: border-box;
}

.flex-c {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cp {
    cursor: pointer;
}

html,
body {
    height: 100%;
}

/* 网格随 repeat 周期位移 56px，首尾相接无跳变；柔光层同步平移 */
@keyframes bg-drift {
    0% {
        background-position: 0 0, 0 0, 0 0, 0% 0%, 85% 15%;
    }

    25% {
        background-position: 14px 14px, 14px 14px, 0 0, 55% 35%, 40% 70%;
    }

    50% {
        background-position: 28px 28px, 28px 28px, 0 0, 100% 55%, 18% 82%;
    }

    75% {
        background-position: 42px 42px, 42px 42px, 0 0, 45% 70%, 72% 28%;
    }

    100% {
        background-position: 56px 56px, 56px 56px, 0 0, 0% 0%, 85% 15%;
    }
}

/* 底层光斑漂移 + 轻微呼吸 */
@keyframes bg-ambience {
    0% {
        transform: translate(-8%, -6%) scale(1.06) rotate(0deg);
        opacity: 0.85;
    }

    33% {
        transform: translate(5%, 4%) scale(1.14) rotate(1deg);
        opacity: 1;
    }

    66% {
        transform: translate(7%, -5%) scale(1.1) rotate(-0.8deg);
        opacity: 0.9;
    }

    100% {
        transform: translate(-8%, -6%) scale(1.06) rotate(0deg);
        opacity: 0.85;
    }
}

/* 斜向流光扫过（高亮带平移） */
@keyframes bg-shimmer {
    0% {
        background-position: -80% 40%;
    }

    100% {
        background-position: 180% 60%;
    }
}

body {
    margin: 0;
    position: relative;
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    /* 网格 + 底色渐变 + 两层可平移的柔色（第 4、5 层） */
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(26, 122, 122, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 122, 122, 0.04) 1px, transparent 1px),
        linear-gradient(165deg, #f6f8fa 0%, #e9eef2 42%, #e4e9ed 100%),
        radial-gradient(ellipse 120% 90% at 30% 20%, rgba(38, 144, 144, 0.14) 0%, transparent 55%),
        radial-gradient(ellipse 100% 100% at 70% 85%, rgba(160, 185, 205, 0.28) 0%, transparent 50%);
    background-size:
        56px 56px,
        56px 56px,
        100% 100%,
        220% 220%,
        200% 200%;
    background-position: 0 0, 0 0, 0 0, 0% 0%, 85% 15%;
    background-repeat: repeat, repeat, no-repeat, no-repeat, no-repeat;
    animation: bg-drift 22s ease-in-out infinite;
    color: var(--text);
    padding: 28px;
}

body::before {
    content: "";
    position: fixed;
    inset: -24%;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(ellipse 85% 65% at 45% 38%, rgba(26, 122, 122, 0.12) 0%, transparent 58%),
        radial-gradient(ellipse 75% 58% at 55% 62%, rgba(200, 215, 228, 0.24) 0%, transparent 52%);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    animation: bg-ambience 18s ease-in-out infinite;
}

/* 极淡流光带，周期性扫过，增强「动态」观感 */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: linear-gradient(118deg,
            transparent 0%,
            transparent 36%,
            rgba(255, 255, 255, 0.22) 48%,
            rgba(230, 242, 242, 0.35) 50%,
            rgba(255, 255, 255, 0.18) 52%,
            transparent 64%,
            transparent 100%);
    background-size: 240% 240%;
    background-repeat: no-repeat;
    animation: bg-shimmer 14s ease-in-out infinite;
    opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
    body {
        animation: none;
        background-position: 0 0, 0 0, 0 0, 50% 50%, 50% 50%;
    }

    body::before,
    body::after {
        animation: none;
        transform: none;
        opacity: 1;
    }

    body::after {
        opacity: 0;
    }
}

#root {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shell {
    width: 90%;
    min-height: 800px;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 50%, #f5f7f9 100%);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: grid;
    grid-template-columns: 320px 1fr;
}

.sidebar {
    padding: 28px 24px;
    background: linear-gradient(180deg, #f0f3f6 0%, #e8ecf0 100%);
    border-right: 1px solid var(--card-border);
    position: relative;
}

/* 侧边栏淡雅医疗波纹装饰 */
.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath fill='none' stroke='%231a7a7a' stroke-opacity='0.06' stroke-width='1' d='M0 60h120M60 0v120'/%3E%3Ccircle cx='60' cy='60' r='28' fill='none' stroke='%231a7a7a' stroke-opacity='0.05'/%3E%3C/svg%3E");
    opacity: 1;
    border-radius: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--primary), var(--primary-2) 55%, #4aacac);
    box-shadow: 0 8px 22px rgba(26, 122, 122, 0.28);
    display: grid;
    place-items: center;
    color: white;
    font-weight: 700;
    position: relative;
}

/* 角标小十字 · 医疗意象 */
.logo::after {
    content: "";
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 10px;
    height: 10px;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)) center / 8px 2px no-repeat,
        linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)) center / 2px 8px no-repeat;
    opacity: 0.95;
}

.brand h1 {
    font-size: 18px;
    margin: 0;
    letter-spacing: 0.3px;
    color: var(--text);
}

.brand p {
    margin: 3px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.metric-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.metric {
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid #cfd6dd;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(42, 70, 82, 0.04);
}

.metric .label {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 20px;
    text-align: center;
    font-weight: bold;
}

.metric.btn-primary {
    border-color: var(--primary-2);
    background: var(--primary-soft);
    box-shadow: 0 4px 14px rgba(26, 122, 122, 0.15);
}

.metric.btn-primary .label {
    color: var(--primary);
}

.tip {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(26, 122, 122, 0.08), rgba(255, 255, 255, 0.9));
    border: 1px solid rgba(26, 122, 122, 0.2);
    font-size: 12px;
    color: var(--text);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.main {
    padding: 26px;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 18px;
    background: linear-gradient(180deg, #fafcfd 0%, #f5f7f9 100%);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.title h2 {
    margin: 0;
    font-size: 24px;
    letter-spacing: 0.4px;
    color: var(--text);
}

.title p {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

.clock {
    padding: 10px 14px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--card-border);
    font-size: 12px;
    color: var(--text-muted);
    box-shadow: 0 2px 10px rgba(42, 70, 82, 0.06);
}

.panel {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: 0 4px 20px rgba(42, 70, 82, 0.05);
}

.search-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.field {
    flex: 1;
    display: flex;
    align-items: center;
}

.field label {
    font-size: 18px;
    color: var(--text-muted);
    margin-right: 30px;
    font-weight: bold;
}

.field input {
    flex: 1;
    height: 40px;
    border-radius: 12px;
    border: 1px solid #c8d0d8;
    background: #f9fafb;
    color: var(--text);
    padding: 0 12px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.field input::placeholder {
    font-size: 14px;
    color: #88929c;
}

.field input:focus {
    border-color: var(--primary-2);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 122, 122, 0.15);
}

.secach {
    margin-left: 20px;
}

.btn {
    width: 100px;
    border: 0;
    border-radius: 12px;
    height: 42px;
    cursor: pointer;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: transform .12s ease, filter .2s;
}

.btn:hover {
    filter: brightness(1.06);
}

.btn:active {
    transform: translateY(1px) scale(0.995);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 10px 22px rgba(26, 122, 122, 0.28);
}

.btn-success {
    background: linear-gradient(135deg, #278a52, var(--success));
    box-shadow: 0 12px 24px rgba(42, 143, 90, 0.22);
}

.btn-error {
    background: linear-gradient(135deg, #999, #333);
    box-shadow: 0 12px 24px rgba(143, 173, 157, 0.22);
}

.list-wrap {
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 0;
}

.list-wrap h3,
.patient-card h3 {
    margin: 0;
    font-size: 16px;
    letter-spacing: 0.2px;
    color: var(--text);
}

.record-list {
    margin-top: 10px;
    height: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-right: 4px;
}

.table-scroll {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding-right: 6px;
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-block;
    object-fit: cover;
    border: 1px solid var(--card-border);
    background: #eef1f4;
    box-shadow: 0 4px 12px rgba(42, 70, 82, 0.08);
}

.avatar-img {
    width: 60px;
    height: 35px;
    border-radius: 5px;
    display: inline-block;
    object-fit: cover;
    border: 1px solid var(--card-border);
    background: #eef1f4;
    box-shadow: 0 4px 12px rgba(42, 70, 82, 0.08);
}

.table-list-td.col-index {
    width: 64px;
    text-align: center;
    color: var(--text-muted);
}

.table-list-td.col-avatar {
    width: 92px;
    text-align: center;
}

.table-list-td.col-actions {
    width: 64px;
    text-align: center !important;
}

.table-list-td.col-fee {
    width: 92px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #b84444;
    font-weight: 700;
}

.table-list-td.col-time,
.table-list-td.col-date,
.table-list-td.col-created {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.table-list-td.col-date {
    width: 120px;
}

.table-list-td.col-time {
    width: 92px;
}

.table-list-td.col-created {
    width: 168px;
}

.table-list-td.col-created {
    overflow: visible;
    text-overflow: clip;
}

.table-list-td.col-phone {
    width: 136px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.table-list-td.col-visited {
    width: 92px;
    white-space: nowrap;
}

.table-list-td.col-doctor,
.table-list-td.col-registrar {
    white-space: nowrap;
}

.table-list-td.col-name {
    white-space: nowrap;
}

.table-list-td.col-name {
    min-width: 120px;
}

.table-list-null {
    margin-top: 12px;
    padding: 18px 12px;
    text-align: center;
    border-radius: 14px;
    border: 1px dashed #b8c4ce;
    background: linear-gradient(180deg, #f8fafb, #f0f3f6);
    color: var(--text-muted);
    font-size: 12px;
}

.table-list {
    width: 100%;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    border-collapse: separate;
    border-spacing: 0;
    margin: 12px 0 0;
    padding: 0;
    background: #fbfcfd;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(42, 70, 82, 0.07);
}

/* 让表头固定，tbody 单独滚动 */
.table-list thead,
.table-list tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.table-list tbody {
    display: block;
    max-height: 410px;
    overflow-y: auto;
    overflow-x: hidden;
}

.table-list-tr:hover {
    background: rgba(26, 122, 122, 0.07);
}

.table-list-tr {
    width: 100%;
    font-size: 12px;
    background: transparent;
}

.listitem-li-input {
    width: 14px;
    height: 14px;
    accent-color: var(--primary-2);
}

/* 列强调交给 col-xxx，不再依赖 nth-of-type */
.table-list tbody .table-list-td.col-doctor {
    font-weight: 700;
    color: var(--text);
}

.controls {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    border: 1px solid #c8d0d8;
    box-sizing: border-box;
    background: #ffffff;
    transition: transform .12s ease, border-color .2s, background .2s, filter .2s;
}

.controls:hover {
    border-color: var(--primary-2);
    background: var(--primary-soft);
    filter: brightness(1.02);
}

.controls:active {
    transform: translateY(1px) scale(0.98);
}

.controls-verify:hover {
    border-color: rgba(42, 143, 90, 0.55);
    background: rgba(42, 143, 90, 0.12);
}

.icon-verify {
    width: 16px;
    height: 16px;
    fill: var(--primary);
}

.controls img {
    width: 16px;
    height: 16px;
}

.table-list-td:first-of-type {
    text-align: center !important;
}

.table-list-header {
    width: 100%;
    background: linear-gradient(135deg, rgba(26, 122, 122, 0.14), #f0f5f5);
    padding: 10px 8px;
    color: var(--text);
    font-weight: bold;
    font-size: 12px;
    border-bottom: 1px solid var(--card-border);
}

.table-list-td {
    text-align: left;
    padding: 10px 10px;
    color: var(--text);
    border-right: 1px solid #e8ecef;
    border-bottom: 1px solid #e8ecef;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

th.table-list-td {
    font-weight: 700;
}

.table-list-header .table-list-td {
    color: var(--text);
    letter-spacing: 0.2px;
    border-bottom: 1px solid var(--card-border);
}

/* 表头固定（更稳：sticky 作用在 th 上） */
.table-list thead th.table-list-td {
    position: sticky;
    top: 0;
    z-index: 3;
    background: linear-gradient(135deg, rgba(26, 122, 122, 0.16), #eef4f4);
}

.table-list-tr:last-child .table-list-td {
    border-bottom: 0;
}

.table-list-td:last-child {
    border-right: 0;
}

/* 旧的 nth-of-type 列宽规则已废弃：改用 col-xxx 类精确控制 */

.table-list-td:first-of-type {
    text-align: center !important;
}

.paging-device {
    margin-top: 10px;
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
    justify-content: space-between;
}

.paging-device-right {
    display: flex;
}

.drop-down-box {
    height: 28px;
    border-radius: 10px;
    font-size: 12px;
    background: #ffffff;
    border: 1px solid #c8d0d8;
    color: var(--text);
    outline: none;
}

.ml {
    margin-left: 5px;
}

.right-button {
    display: flex;
}

.common-header-buttonclo {
    cursor: not-allowed !important;
    opacity: 0.55;
}

.common-header-button:hover {
    border: 1px solid var(--primary-2);
    background: var(--primary-soft) !important;
}

.common-header-button {
    width: auto;
    height: 28px;
    padding: 0 10px;
    display: block;
    font-size: 12px;
    line-height: 28px;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid #c8d0d8;
    cursor: pointer;
    background: #ffffff;
    color: var(--text);
    margin-left: 5px;
    transition: transform .12s ease, border-color .2s, background .2s, filter .2s;
}

.common-header-button:active {
    transform: translateY(1px) scale(0.99);
}

.right-total {
    border: 1px solid var(--card-border);
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: var(--text-muted);
    box-shadow: 0 2px 8px rgba(42, 70, 82, 0.04);
}

.right-total span,
font {
    font-size: 12px;
}

.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(42, 55, 68, 0.45);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 999;
}

.modal {
    width: min(520px, 100%);
    border-radius: 18px;
    border: 1px solid var(--card-border);
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
    box-shadow: 0 28px 80px rgba(42, 70, 82, 0.18);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--card-border);
    background: linear-gradient(90deg, rgba(26, 122, 122, 0.06), transparent);
}

.modal-title {
    font-weight: 800;
    letter-spacing: 0.2px;
    color: var(--text);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: #f4f6f8;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 16px;
}

.modal-sub {
    font-size: 13px;
    color: var(--text);
    margin-bottom: 12px;
}

.modal-muted {
    color: var(--text-muted);
}

.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.radio {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    background: #fafbfc;
    cursor: pointer;
    user-select: none;
    color: var(--text);
}

.radio input {
    accent-color: var(--primary-2);
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 16px;
    border-top: 1px solid var(--card-border);
    background: #f8fafb;
}

.modal-btn {
    width: auto;
    padding: 0 14px;
}

.modal-btn-primary {
    height: 34px;
    border-radius: 10px;
    font-size: 12px;
    letter-spacing: 0.1px;
    padding: 0 12px;
    box-shadow: 0 10px 22px rgba(42, 143, 90, 0.2);
}