/* 患者居家随访与健康教育管理系统 - 全局样式 */

:root {
    --primary: #0891b2;
    --primary-dark: #0e7490;
    --primary-light: #22d3ee;
    --sidebar-bg: #0f172a;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(8, 145, 178, 0.25);
    --sidebar-text: #cbd5e1;
    --sidebar-text-active: #ffffff;
    --page-bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --radius: 10px;
    --radius-lg: 14px;
}

/* 一览列表：名称下方灰色编号 */
.list-name-cell { line-height: 1.4; }
.list-code-sub { font-size: 12px; color: #909399; margin-top: 2px; word-break: break-all; }

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

[v-cloak] {
    display: none !important;
}

body {
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    color: var(--text-primary);
    background: var(--page-bg);
    -webkit-font-smoothing: antialiased;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #164e63 50%, #0891b2 100%);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: "";
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    pointer-events: none;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
    color: #fff;
}

.login-brand-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    display: block;
}

.brand-logo--login {
    width: 72px;
    height: 72px;
    border-radius: 16px;
}

.login-brand h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-brand p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.login-card .el-form-item {
    margin-bottom: 22px;
}

.login-card .el-input__inner {
    height: 44px;
    border-radius: 8px;
}

.login-btn {
    width: 100%;
    height: 44px;
    font-size: 15px;
    border-radius: 8px;
    letter-spacing: 2px;
}

.login-hint {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.8;
}

.field-hint {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.app-layout {
    height: 100vh;
    display: flex;
    overflow: hidden;
}

.app-sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    transition: width 0.2s ease;
}

.app-sidebar.is-collapsed {
    width: 64px;
}

.app-sidebar.is-collapsed .app-sidebar-brand-text {
    display: none;
}

.app-sidebar.is-collapsed .app-sidebar-brand {
    padding: 16px 12px;
    justify-content: center;
}

.app-sidebar.is-collapsed .app-sidebar-footer {
    padding: 12px 8px;
}

.app-sidebar.is-collapsed .app-sidebar-footer-text {
    display: none;
}

.app-sidebar.is-collapsed .app-sidebar-nav {
    padding: 12px 6px;
}

.app-sidebar.is-collapsed .app-sidebar-nav .el-menu-item.is-active::before {
    display: none;
}

.app-sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-sidebar-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.app-sidebar-brand-text {
    min-width: 0;
    flex: 1;
}

.app-sidebar-brand-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    margin: 0;
}

.app-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
}

.app-sidebar-nav .el-menu {
    border-right: none !important;
    background: transparent !important;
}

.app-sidebar-nav .el-menu-item {
    height: 46px;
    line-height: 46px;
    border-radius: 8px;
    margin-bottom: 4px;
    color: var(--sidebar-text) !important;
    font-size: 14px;
    transition: all 0.2s ease;
}

.app-sidebar-nav .el-menu-item i {
    color: var(--sidebar-text);
    margin-right: 10px;
    font-size: 18px;
    vertical-align: middle;
}

.app-sidebar-nav .el-menu-item:hover {
    background: var(--sidebar-hover) !important;
    color: #fff !important;
}

.app-sidebar-nav .el-menu-item:hover i {
    color: var(--primary-light);
}

.app-sidebar-nav .el-menu-item.is-active {
    background: var(--sidebar-active) !important;
    color: var(--sidebar-text-active) !important;
    font-weight: 500;
    position: relative;
}

.app-sidebar-nav .el-menu-item.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary-light);
    border-radius: 0 3px 3px 0;
}

.app-sidebar-nav .el-menu-item.is-active i {
    color: var(--primary-light);
}

.app-sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.app-sidebar-footer-text {
    flex: 1;
    text-align: center;
}

.app-sidebar-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.app-sidebar-collapse-btn i {
    font-size: 16px;
}

.app-sidebar.is-collapsed .app-sidebar-collapse-btn {
    margin: 0 auto;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--page-bg);
}

.app-header {
    height: 60px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    gap: 12px;
}

.app-header-left {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
    gap: 8px;
}

.app-header-brand {
    flex: 1;
    min-width: 0;
    max-width: calc(100vw - 280px);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    padding-right: 12px;
}

.app-header-hospital-logo {
    max-height: 42px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: left center;
    vertical-align: middle;
}

.app-header-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.app-header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.app-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 4px;
    border: none;
    border-radius: 8px;
    background: var(--page-bg);
    color: var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-sidebar-toggle:hover {
    background: #e2e8f0;
    color: var(--primary);
}

.app-sidebar-toggle i {
    font-size: 18px;
}

.app-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.app-header-info {
    display: flex;
    flex-direction: column;
}

.app-header-username {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}

.app-header-role {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.app-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.app-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: var(--page-bg);
}

.app-iframe-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--page-bg);
    z-index: 1;
}

.page-container {
    padding: 20px 24px;
    min-height: 100%;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

.page-card {
    border-radius: var(--radius) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
    margin-bottom: 16px;
}

.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.review-publish-notice {
    margin-bottom: 12px;
}

.review-status-cell {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.review-reject-info-icon {
    font-size: 14px;
    color: #f56c6c;
    cursor: pointer;
    vertical-align: middle;
}

.table-pagination {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.welcome-banner {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    color: #fff;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.welcome-banner h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
}

.welcome-banner p {
    font-size: 14px;
    opacity: 0.85;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-info .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-card-info .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card-icon.blue { background: #eff6ff; color: #3b82f6; }
.stat-card-icon.green { background: #ecfdf5; color: #10b981; }
.stat-card-icon.orange { background: #fff7ed; color: #f97316; }
.stat-card-icon.red { background: #fef2f2; color: #ef4444; }
.stat-card-icon.purple { background: #f5f3ff; color: #8b5cf6; }
.stat-card-icon.teal { background: #f0fdfa; color: #14b8a6; }

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 900px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    background: var(--page-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    background: #ecfeff;
    transform: translateY(-1px);
}

.quick-action-btn i {
    font-size: 28px;
    color: var(--primary);
}

.quick-action-btn span {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.coming-soon {
    text-align: center;
    padding: 60px 20px;
}

.coming-soon-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coming-soon-icon i {
    font-size: 36px;
    color: var(--primary);
}

.coming-soon h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.coming-soon p {
    font-size: 14px;
    color: var(--text-secondary);
}

.el-button--primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.el-button--primary:hover,
.el-button--primary:focus {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

.el-table th {
    background-color: #f8fafc !important;
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   移动端适配（≤768px）
   ========================================================================== */

.app-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 8px;
    border: none;
    border-radius: 8px;
    background: var(--page-bg);
    color: var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.app-menu-toggle i {
    font-size: 20px;
}

.app-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000;
}

.app-sidebar-overlay.visible {
    display: block;
}

.table-scroll-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    body.mobile-sidebar-open {
        overflow: hidden;
    }

    .app-menu-toggle {
        display: inline-flex;
    }

    .app-sidebar-toggle {
        display: none;
    }

    .app-sidebar-collapse-btn {
        display: none;
    }

    .app-layout {
        position: relative;
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1001;
        width: 260px;
        max-width: 85vw;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: none;
    }

    .app-sidebar.is-collapsed {
        width: 260px;
        max-width: 85vw;
    }

    .app-sidebar.is-collapsed .app-sidebar-brand-text,
    .app-sidebar.is-collapsed .app-sidebar-footer-text {
        display: block;
    }

    .app-sidebar.is-collapsed .app-sidebar-brand {
        padding: 24px 20px;
        justify-content: flex-start;
    }

    .app-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    }

    .app-header {
        height: auto;
        min-height: 52px;
        padding: 8px 12px;
        gap: 8px;
    }

    .app-header-title {
        flex: 1;
        min-width: 0;
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-header-left {
        flex: 1;
        min-width: 0;
    }

    .bulletin-dialog-nav {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .bulletin-dialog-nav .el-button {
        width: 100%;
    }

    .bulletin-dialog-counter {
        text-align: center;
    }

    .app-header-user {
        gap: 4px;
        flex-shrink: 0;
    }

    .app-header-info {
        display: none;
    }

    .app-header-user-arrow {
        display: none;
    }

    .app-header-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .app-header-user .el-button--text {
        padding: 6px 8px;
        margin-left: 0;
    }

    .page-container {
        padding: 12px;
    }

    .page-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .page-toolbar > span {
        margin-bottom: 8px;
    }

    .page-toolbar .el-button {
        width: 100%;
    }

    .welcome-banner {
        padding: 20px 16px;
    }

    .welcome-banner h2 {
        font-size: 18px;
        padding-right: 0;
    }

    .banner-bulletin-entry {
        position: static !important;
        display: inline-flex;
        margin-bottom: 12px;
    }

    .banner-ticker-line {
        max-width: 100% !important;
    }

    .stat-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card-item {
        padding: 16px;
    }

    .stat-card-info .stat-value {
        font-size: 22px;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .quick-action-btn {
        padding: 16px 8px;
    }

    .login-page {
        padding: 16px;
        align-items: flex-start;
        padding-top: 48px;
    }

    .login-brand {
        margin-bottom: 24px;
    }

    .login-brand h1 {
        font-size: 18px;
        line-height: 1.45;
    }

    .login-card {
        padding: 24px 20px;
    }

    /* 搜索表单：inline 改为纵向堆叠 */
    .el-form--inline {
        display: block;
    }

    .el-form--inline .el-form-item {
        display: block;
        margin-right: 0;
        margin-bottom: 12px;
        width: 100%;
    }

    .el-form--inline .el-form-item__label {
        display: block;
        text-align: left;
        float: none;
        line-height: 1.4;
        padding: 0 0 6px;
    }

    .el-form--inline .el-form-item__content {
        display: block;
        width: 100% !important;
    }

    .el-form--inline .el-input,
    .el-form--inline .el-select,
    .el-form--inline .el-date-editor {
        width: 100% !important;
    }

    .el-form--inline .el-button + .el-button {
        margin-left: 0;
        margin-top: 8px;
    }

    .el-form--inline .el-form-item:last-child .el-button {
        width: 100%;
    }

    /* 表格横向滚动 */
    .page-card .el-card__body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .page-card .el-table {
        min-width: 640px;
    }

    .table-scroll-wrap .el-table {
        min-width: 640px;
    }

    /* 标签页 */
    .el-tabs__header {
        margin-bottom: 12px;
    }

    .el-tabs__nav-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .el-tabs__nav-scroll {
        overflow: visible;
    }

    .el-tabs__item {
        padding: 0 14px;
        font-size: 13px;
    }

    /* 弹窗 */
    .el-dialog {
        width: 92% !important;
        max-width: 92vw;
        margin-top: 4vh !important;
    }

    .el-dialog__body {
        padding: 16px;
        max-height: 70vh;
        overflow-y: auto;
    }

    .el-dialog__footer {
        padding: 10px 16px 16px;
    }

    .el-dialog__footer .el-button {
        min-width: 80px;
    }

    /* 表单 label 上置（固定 label-width 的表单） */
    .el-form:not(.el-form--inline) .el-form-item__label {
        width: 100% !important;
        text-align: left;
        float: none;
        line-height: 1.4;
        padding-bottom: 4px;
    }

    .el-form:not(.el-form--inline) .el-form-item__content {
        margin-left: 0 !important;
    }

    .field-hint[style*="padding-left"] {
        padding-left: 0 !important;
    }

    /* 分页 */
    .el-pagination {
        white-space: normal;
        text-align: center;
        padding: 8px 0;
    }

    .el-pagination .el-pagination__sizes,
    .el-pagination .el-pagination__jump {
        display: none;
    }

    .el-pagination .btn-prev,
    .el-pagination .btn-next,
    .el-pagination .el-pager li {
        min-width: 28px;
    }

    /* 抽屉（页面帮助） */
    .el-drawer.rtl {
        width: 88% !important;
    }

    .coming-soon {
        padding: 40px 16px;
    }
}

@media (max-width: 480px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }

    .app-header-user .app-header-avatar {
        display: none;
    }

    .login-brand h1 {
        font-size: 16px;
    }
}
