/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 登录页样式 */
body.login-page {
    background: #fff;
    color: #303133;
    min-height: 100vh;
}

.login-page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.login-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 40px;
    border-bottom: 1px solid #f0f2f5;
    flex-shrink: 0;
}

.login-topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.login-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #409eff;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 4px;
    flex-shrink: 0;
}

.login-brand-name {
    font-size: 18px;
    font-weight: 700;
    color: #1f2a37;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.login-topbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
}

.login-top-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #606266;
    font-size: 13px;
    text-decoration: none;
}

.login-top-link svg {
    width: 16px;
    height: 16px;
}

.login-top-link:hover {
    color: #409eff;
}

.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px 24px;
}

.login-card {
    display: flex;
    width: 100%;
    max-width: 920px;
    min-height: 420px;
    background: #f3f6fa;
    overflow: hidden;
}

.login-illustration {
    flex: 1.05;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px 28px 32px;
    background: #eef3f9;
}

.login-hero-image {
    width: 100%;
    max-width: 380px;
    display: block;
}

.login-panel {
    flex: 0.95;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 52px 44px;
    background: #f7f9fc;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    color: #409eff;
    margin: 0 0 28px;
    padding-bottom: 10px;
    border-bottom: 2px solid #409eff;
    width: fit-content;
    line-height: 1.2;
}

.login-form .form-group,
.login-form .login-field {
    margin-bottom: 22px;
}

.login-underline-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    border-bottom: 1px solid #dcdfe6;
    transition: border-color 0.2s ease;
}

.login-underline-field:focus-within {
    border-bottom-color: #409eff;
}

.login-field-icon {
    display: inline-flex;
    color: #909399;
    flex-shrink: 0;
}

.login-field-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.login-input {
    flex: 1;
    width: 100%;
    height: 40px;
    padding: 0;
    border: none !important;
    border-radius: 0;
    background: transparent;
    box-shadow: none !important;
    font-size: 14px;
    color: #303133;
    outline: none;
}

.login-input:focus {
    outline: none;
    border: none !important;
    box-shadow: none !important;
}

.login-input::placeholder {
    color: #c0c4cc;
}

.login-captcha-field {
    gap: 12px;
}

.login-captcha-field .captcha-input {
    min-width: 0;
}

.captcha-image {
    width: 104px;
    height: 36px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    object-fit: cover;
    background: #fff;
    flex-shrink: 0;
}

.login-remember {
    margin: 4px 0 18px;
}

.login-remember-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #606266;
    cursor: pointer;
    user-select: none;
}

.login-remember-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #409eff;
    cursor: pointer;
}

.login-submit-wrap {
    margin-bottom: 0 !important;
}

.login-submit {
    width: 100%;
    height: 42px;
    margin-top: 0;
    border: none;
    border-radius: 2px;
    background: #409eff !important;
    border-color: #409eff !important;
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.login-submit:hover {
    background: #66b1ff !important;
    border-color: #66b1ff !important;
}

.login-alert {
    margin-bottom: 16px;
}

.login-field .invalid-feedback {
    display: block;
    margin-top: 6px;
    font-size: 12px;
}

.login-footer {
    padding: 16px 24px 28px;
    text-align: center;
    color: #909399;
    font-size: 12px;
    flex-shrink: 0;
}

.login-copyright {
    margin-bottom: 4px;
}

@media (max-width: 900px) {
    .login-topbar {
        padding: 0 16px;
        height: 56px;
    }

    .login-topbar-actions {
        gap: 10px;
    }

    .login-top-link span,
    .login-top-link {
        font-size: 12px;
    }

    .login-main {
        padding: 24px 16px;
    }

    .login-card {
        flex-direction: column;
        max-width: 480px;
        min-height: auto;
    }

    .login-illustration {
        padding: 20px 16px 8px;
    }

    .login-hero-image {
        max-width: 260px;
    }

    .login-panel {
        padding: 24px 28px 32px;
    }

    .login-title {
        font-size: 20px;
        margin-bottom: 22px;
    }
}

@media (max-width: 480px) {
    .login-top-link {
        font-size: 0;
        gap: 0;
    }

    .login-top-link svg {
        width: 18px;
        height: 18px;
    }

    .login-brand-name {
        font-size: 15px;
    }
}

.permission-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    background-color: #fafafa;
}

.permission-group-title {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

/* 后台通用表单：无标签，左对齐 */
body.admin-body .main-content form:not(.search-form):not(.customer-search-form):not(.customer-form-page):not(.employee-form-page):not(.settings-inline-form):not(.follow-compose-form):not(.admin-form-modal-form) .form-group {
    display: block;
    margin-bottom: 14px;
    padding-left: 0;
}

body.admin-body .main-content form:not(.search-form):not(.customer-search-form):not(.customer-form-page):not(.employee-form-page):not(.settings-inline-form):not(.follow-compose-form):not(.admin-form-modal-form) .form-control,
body.admin-body .main-content form:not(.search-form):not(.customer-search-form):not(.customer-form-page):not(.employee-form-page):not(.settings-inline-form):not(.follow-compose-form):not(.admin-form-modal-form) select.form-control {
    width: 100%;
    max-width: none;
    padding: 8px 10px;
}

body.admin-body .main-content form:not(.search-form):not(.customer-search-form):not(.customer-form-page):not(.employee-form-page):not(.settings-inline-form):not(.follow-compose-form):not(.admin-form-modal-form) .watermark,
body.admin-body .main-content form:not(.search-form):not(.customer-search-form):not(.customer-form-page):not(.employee-form-page):not(.settings-inline-form):not(.follow-compose-form):not(.admin-form-modal-form) .invalid-feedback {
    width: auto;
    margin: 4px 0 0;
    padding-left: 0;
}

body.admin-body .follow-compose-form .form-group .form-control {
    max-width: none;
    width: 100%;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    border-radius: var(--control-radius, 4px);
}

input:not([type='checkbox']):not([type='radio']):not([type='hidden']):not([type='file']),
select,
textarea {
    border-radius: var(--control-radius, 4px);
}

.form-control-readonly {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

.form-control:focus {
    outline: none;
    border-color: #4a90e2;
}

.customer-form-card .card-body {
    padding: 20px 24px 24px;
}

.customer-form-page-body {
    padding: 20px 24px 24px;
}

.customer-form-layout {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.customer-form-section {
    margin: 0;
}

.customer-form-section-title {
    margin: 0 0 16px;
    padding: 0;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
}

.customer-form-page .customer-form-grid,
.customer-form-layout .customer-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    max-width: 720px;
}

.customer-form-page .form-group,
.customer-form-layout .form-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 0;
    padding: 0;
    min-height: 0;
}

.customer-form-page .form-inline-label,
.customer-form-layout .form-inline-label {
    display: inline-block;
    width: 88px;
    flex-shrink: 0;
    text-align: right;
    padding-top: 9px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    line-height: 1.4;
    white-space: normal;
}

.customer-form-page .form-field-body,
.customer-form-layout .form-field-body {
    flex: 1;
    min-width: 0;
}

.customer-form-page .form-label,
.customer-form-layout .form-label {
    display: none;
}

.customer-form-page .form-control,
.customer-form-page select.form-control,
.customer-form-layout .form-control,
.customer-form-layout select.form-control {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 9px 12px;
}

.customer-form-page .invalid-feedback,
.customer-form-layout .invalid-feedback {
    width: auto;
    margin-top: 4px;
    padding-left: 0;
}

.customer-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #eef0f3;
}

.employee-form-page .employee-form-layout {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.employee-form-page .employee-form-section-title {
    margin: 0 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
}

.employee-form-page .employee-form-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.employee-form-page .form-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    padding: 0;
}

.employee-form-page .form-group:last-child {
    margin-bottom: 0;
}

.employee-form-page .form-group.form-group-full {
    align-items: flex-start;
}

.employee-form-page .form-inline-label {
    display: inline-block;
    width: 120px;
    flex-shrink: 0;
    text-align: right;
    padding-top: 9px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    line-height: 1.4;
}

.employee-form-page .form-field-body {
    flex: 1;
    min-width: 0;
    max-width: 520px;
}

.employee-form-page .form-group.form-group-full .form-field-body {
    max-width: none;
}

.employee-form-page .form-label {
    display: none;
}

.employee-form-page .form-control,
.employee-form-page select.form-control {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 9px 12px;
}

.employee-form-page .watermark,
.employee-form-page .invalid-feedback {
    width: auto;
    margin-top: 4px;
    padding-left: 0;
}

.employee-form-page .permission-card,
.employee-form-page .permission-grid {
    max-width: none;
    min-width: 0;
}

.employee-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #eef0f3;
}

@media (max-width: 1200px) {
    .employee-form-page .employee-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .employee-form-page .employee-form-grid {
        grid-template-columns: 1fr;
    }
}

.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
    white-space: nowrap;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    line-height: 1.4;
    border-radius: var(--control-radius, 4px);
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    -webkit-font-smoothing: antialiased;
}

.btn .svg-icon,
.btn .svg-icon-sm,
.btn .svg-icon-lg {
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
}

.btn-primary,
a.btn-primary,
button.btn-primary {
    background-color: #2563eb;
    color: #fff !important;
}

.btn-primary:hover,
a.btn-primary:hover,
button.btn-primary:hover {
    background-color: #1d4ed8;
    color: #fff !important;
}

.btn-danger,
a.btn-danger,
button.btn-danger {
    background-color: #dc3545;
    color: #fff !important;
}

.btn-danger:hover,
a.btn-danger:hover,
button.btn-danger:hover {
    background-color: #c82333;
    color: #fff !important;
}

.btn-secondary {
    background-color: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #cbd5e1;
}

.btn-success {
    background-color: #28a745;
    color: #fff;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* 提示框样式 */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 顶部消息提示（不阻塞操作） */
.admin-toast-wrap {
    position: fixed;
    top: 72px;
    left: 50%;
    z-index: 9999;
    transform: translateX(-50%) translateY(-16px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.admin-toast-wrap.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.admin-toast-wrap.is-hiding {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px);
}

.admin-toast-card {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 330px;
    max-width: 460px;
    padding: 14px 38px 14px 16px;
    border-radius: 0;
    color: #fff;
    box-shadow: none;
    position: relative;
}

.admin-toast-card.admin-toast-success {
    background: #409eff;
}

.admin-toast-card.admin-toast-error {
    background: #f56c6c;
}

.admin-toast-card.admin-toast-warning {
    background: #e6a23c;
}

.admin-toast-status-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 2px;
    background: transparent;
    position: relative;
}

.admin-toast-status-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.admin-toast-card.admin-toast-success .admin-toast-status-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
}

.admin-toast-card.admin-toast-error .admin-toast-status-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E");
}

.admin-toast-card.admin-toast-warning .admin-toast-status-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9v4M12 17h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z'/%3E%3C/svg%3E");
}

.admin-toast-content {
    flex: 1;
    min-width: 0;
}

.admin-toast-head {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 2px;
}

.admin-toast-message {
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.95;
}

.admin-toast-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
}

.admin-toast-close:hover {
    opacity: 1;
}

/* Toast 容器（用于 JS 动态追加） */
.admin-toast-host {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.admin-toast-host .admin-toast-wrap {
    position: relative;
    top: 0;
    left: 0;
    transform: translateY(-12px);
}

.admin-toast-host .admin-toast-wrap.is-visible {
    transform: translateY(0);
}

/* 自定义确认对话框 */
.admin-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.admin-confirm-overlay.is-visible {
    opacity: 1;
}

.admin-confirm-overlay.is-leaving {
    opacity: 0;
}

.admin-confirm-dialog {
    width: 420px;
    max-width: calc(100% - 32px);
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.18s ease;
}

.admin-confirm-overlay.is-visible .admin-confirm-dialog {
    transform: scale(1);
}

.admin-confirm-head {
    padding: 16px 20px 12px;
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    border-bottom: 1px solid #f0f0f0;
}

.admin-confirm-body {
    padding: 18px 20px;
    font-size: 13px;
    line-height: 1.6;
    color: #4b5563;
    white-space: pre-wrap;
    word-break: break-word;
}

.admin-confirm-foot {
    padding: 12px 20px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid #f0f0f0;
    background: #fafbfc;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    height: 32px;
    padding: 0 16px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.admin-btn-default {
    background: #ffffff;
    border-color: #d9d9d9;
    color: #4b5563;
}

.admin-btn-default:hover {
    border-color: #409eff;
    color: #409eff;
}

.admin-btn-primary {
    background: #409eff;
    border-color: #409eff;
    color: #ffffff;
}

.admin-btn-primary:hover {
    background: #66b1ff;
    border-color: #66b1ff;
}

.admin-btn-danger {
    background: #f56c6c;
    border-color: #f56c6c;
    color: #ffffff;
}

.admin-btn-danger:hover {
    background: #f78989;
    border-color: #f78989;
}

/* 后台管理布局 */
body.admin-body {
    background: #f0f2f5;
    color: #333;
    --control-radius: 4px;
}

.svg-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.svg-icon-lg {
    width: 18px;
    height: 18px;
    display: block;
}

.svg-icon-xl {
    width: 24px;
    height: 24px;
    display: block;
}

.metric-tip-icon {
    width: 14px;
    height: 14px;
    display: inline-block;
    vertical-align: -2px;
    color: #c4c4c4;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    position: sticky;
    top: 0;
    width: 230px;
    min-width: 230px;
    height: 100vh;
    background: #1a3a7a;
    color: #dbeafe;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease, min-width 0.2s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 18px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: #3b82f6;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    flex-shrink: 0;
}

.sidebar-brand-logo-wrap {
    width: 40px;
    height: 40px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    overflow: visible;
    flex-shrink: 0;
}

.sidebar-brand-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.login-brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.system-logo-preview {
    width: 120px;
    height: 120px;
    border: 1px dashed #d1d5db;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.system-logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.system-logo-preview-empty {
    background: #eff6ff;
    color: #2563eb;
    font-size: 36px;
    font-weight: 700;
}

.sidebar-brand-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.sidebar-brand-subtitle {
    font-size: 12px;
    color: #93c5fd;
    margin-top: 2px;
}

.sidebar-search {
    padding: 0 16px 12px;
}

.sidebar-search-inner {
    position: relative;
}

.sidebar-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #9ca3af;
    pointer-events: none;
    z-index: 1;
}

.sidebar-search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 34px;
    border: none;
    border-radius: var(--control-radius, 4px);
    background: #fff;
    color: #374151;
    font-size: 13px;
}

.sidebar-search-input::placeholder {
    color: #9ca3af;
}

.sidebar-search-input:focus {
    outline: 2px solid rgba(47, 111, 214, 0.35);
    outline-offset: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 8px 0;
    flex: 1;
}

.sidebar-menu li {
    margin-bottom: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 26px;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    border-radius: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-menu a.active {
    background: #2f6fd6;
    color: #fff;
    margin: 0;
    padding: 11px 26px;
    border-radius: 0;
}

.menu-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.menu-text {
    font-size: 14px;
}

.sidebar-footer {
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
}

.sidebar-toggle {
    width: 100%;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.08);
    color: #dbeafe;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

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

.sidebar-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

body.sidebar-collapsed .sidebar {
    width: 72px;
    min-width: 72px;
}

body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-left: 12px;
    padding-right: 12px;
}

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-search,
body.sidebar-collapsed .menu-text {
    display: none;
}

body.sidebar-collapsed .sidebar-menu {
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .sidebar-menu a {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .sidebar-menu a.active {
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .sidebar-toggle-collapse {
    display: none;
}

body.sidebar-collapsed .sidebar-toggle-expand {
    display: inline-flex;
}

/* 顶栏 */
.admin-topbar {
    height: 52px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.admin-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    line-height: 1.4;
    min-width: 0;
}

.admin-topbar-left {
    display: flex;
    align-items: center;
    min-width: 0;
}

.admin-tab {
    display: inline-block;
    padding: 8px 16px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #dbeafe;
    border-radius: 6px;
}

.admin-breadcrumb-link {
    color: #6b7280;
    text-decoration: none;
}

.admin-breadcrumb-link:hover {
    color: #2563eb;
}

.admin-breadcrumb-sep {
    color: #d1d5db;
    user-select: none;
}

.admin-breadcrumb-current {
    color: #111827;
    font-weight: 500;
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.svg-icon-menu {
    width: 18px;
    height: 18px;
    display: block;
}

.admin-profile-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
}

.admin-profile-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.admin-profile-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.admin-profile-modal-dialog {
    position: relative;
    width: 520px;
    max-width: 100%;
    margin: 0;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    border: 1px solid #e5e7eb;
}

.admin-profile-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eef0f3;
}

.admin-profile-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.admin-profile-modal-close {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.admin-profile-modal-close:hover {
    color: #374151;
}

.admin-profile-modal-body {
    padding: 20px;
}

.admin-profile-modal-body .form-group {
    margin-bottom: 16px;
}

.admin-profile-modal-body .form-group:last-child {
    margin-bottom: 0;
}

.admin-profile-password-divider {
    margin: 8px 0 16px;
    font-size: 13px;
    color: #6b7280;
}

.admin-profile-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 20px 20px;
}

body.profile-modal-open {
    overflow: hidden;
}

/* 主内容区域 */
.main-content {
    padding: 8px 12px 16px 8px;
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.content-icp-footer {
    margin-top: auto;
    padding: 20px 8px 4px;
    text-align: center;
    flex-shrink: 0;
}

.content-icp-link {
    color: #9ca3af;
    font-size: 12px;
    text-decoration: none;
}

.content-icp-link:hover {
    color: #6b7280;
    text-decoration: underline;
}

.main-content.customers-page,
.main-content.admin-list-page,
.main-content.dashboard-page {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--admin-header-height, 86px));
    overflow: hidden;
}

.page-title {
    display: none;
}

/* 首页区块 */
.dashboard-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid #eef0f3;
}

.welcome-card {
    padding: 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.welcome-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.welcome-avatar {
    width: 56px;
    height: 56px;
    display: block;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
    background: #f3f4f6;
}

.welcome-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
}

.welcome-subtitle {
    font-size: 13px;
    color: #6b7280;
}

.welcome-stats {
    display: flex;
    gap: 32px;
    flex-shrink: 0;
}

.welcome-stat-item {
    text-align: center;
    min-width: 72px;
}

.welcome-stat-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 16px;
    color: #fff;
}

.welcome-stat-icon.icon-blue { background: #3b82f6; }
.welcome-stat-icon.icon-green { background: #10b981; }
.welcome-stat-icon.icon-orange { background: #f59e0b; }

.welcome-stat-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.welcome-stat-item strong {
    font-size: 20px;
    color: #1f2937;
    font-weight: 600;
}

.card-inner-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.section-link {
    font-size: 13px;
    color: #2563eb;
    text-decoration: none;
}

.section-link:hover {
    text-decoration: underline;
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.metric-item {
    padding: 20px 24px 16px;
    border-right: 1px solid #f0f0f0;
}

.metric-item:last-child {
    border-right: none;
}

.metric-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.metric-value {
    font-size: 28px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
    line-height: 1.2;
}

.metric-desc {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 0;
    min-height: 18px;
}

.metric-line {
    display: none;
}

.metric-blue .metric-line,
.metric-green .metric-line,
.metric-orange .metric-line,
.metric-purple .metric-line {
    display: none;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 20px 28px;
    padding: 22px 28px 30px;
}

.quick-item {
    text-decoration: none;
    color: #374151;
    text-align: center;
    transition: transform 0.15s ease;
}

.quick-item:hover {
    transform: translateY(-2px);
}

.quick-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.quick-svg {
    width: 26px;
    height: 26px;
    display: block;
}

.quick-icon-blue {
    background: #eff6ff;
    color: #2563eb;
    border-color: #dbeafe;
}

.quick-icon-cyan {
    background: #ecfeff;
    color: #0891b2;
    border-color: #cffafe;
}

.quick-icon-indigo {
    background: #eef2ff;
    color: #4f46e5;
    border-color: #e0e7ff;
}

.quick-icon-purple {
    background: #f5f3ff;
    color: #7c3aed;
    border-color: #ede9fe;
}

.quick-icon-orange {
    background: #fff7ed;
    color: #ea580c;
    border-color: #ffedd5;
}

.quick-item:hover .quick-icon-blue {
    background: #dbeafe;
}

.quick-item:hover .quick-icon-cyan {
    background: #cffafe;
}

.quick-item:hover .quick-icon-indigo {
    background: #e0e7ff;
}

.quick-item:hover .quick-icon-purple {
    background: #ede9fe;
}

.quick-item:hover .quick-icon-orange {
    background: #ffedd5;
}

.quick-text {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
}

.dashboard-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-page > .dashboard-card {
    flex-shrink: 0;
}

.dashboard-page .dashboard-split {
    flex: 1;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
    grid-template-columns: minmax(0, 1.75fr) minmax(220px, 0.72fr);
    align-items: stretch;
}

body.sidebar-collapsed .dashboard-page .dashboard-split {
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.88fr);
}

.dashboard-page .dashboard-split .dashboard-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0;
}

.dashboard-page .dashboard-split .dashboard-card:last-child .card-chart-wrap {
    flex: 1;
    min-height: 0;
}

.dashboard-page .dashboard-split .card-inner-head {
    flex-shrink: 0;
}

.dashboard-page .dashboard-split .card-table-wrap {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow: auto;
}

.dashboard-page .dashboard-split .card-chart-wrap {
    width: 100%;
    padding: 16px 18px;
    display: flex;
    flex-direction: row;
    gap: 16px;
    overflow: visible;
    box-sizing: border-box;
}

/* 侧栏展开：卡片随高度自适应，内容垂直居中 */
body:not(.sidebar-collapsed) .dashboard-page .dashboard-split .dashboard-card:last-child {
    align-self: stretch;
}

body:not(.sidebar-collapsed) .dashboard-page .dashboard-split .dashboard-card:last-child .card-chart-wrap {
    align-items: center;
    justify-content: flex-start;
    padding: 14px 16px;
    gap: 12px;
}

body:not(.sidebar-collapsed) .dashboard-chart-canvas-wrap {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
}

/* 侧栏收起：内容水平+垂直居中 */
body.sidebar-collapsed .dashboard-page .dashboard-split .dashboard-card:last-child .card-chart-wrap {
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    gap: 20px;
}

body.sidebar-collapsed .dashboard-chart-canvas-wrap {
    flex: 0 0 140px;
    width: 140px;
    height: 140px;
}

body.sidebar-collapsed .dashboard-page .dashboard-split .order-stage-legend {
    flex: 0 1 auto;
}

.dashboard-page .dashboard-split .card-chart-wrap .empty-state {
    flex: 1;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-chart-canvas-wrap {
    flex: 0 0 128px;
    width: 128px;
    height: 128px;
    position: relative;
}

.dashboard-chart-canvas-wrap canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.order-stage-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-stage-legend li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: #4b5563;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
}

.dashboard-split .admin-table .table-time-col,
.dashboard-split .admin-table .table-time-cell {
    white-space: nowrap;
    width: 1%;
}

.dashboard-split .admin-table .table-time-cell {
    color: #4b5563;
    font-size: 13px;
}

.order-stage-legend li:last-child {
    border-bottom: none;
}

.order-stage-legend-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.order-stage-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.order-stage-legend-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-stage-legend-value {
    color: #111827;
    font-weight: 600;
    flex-shrink: 0;
}

.dashboard-page .dashboard-split .card-table-wrap .empty-state {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-split .dashboard-card {
    margin-bottom: 0;
}

.card-table-wrap {
    padding: 0;
}

.card-table-wrap .admin-table th:first-child,
.card-table-wrap .admin-table td:first-child {
    padding-left: 24px;
}

.card-table-wrap .admin-table th:last-child,
.card-table-wrap .admin-table td:last-child {
    padding-right: 24px;
}

.panel-card,
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid #eef0f3;
}

.page-toolbar {
    margin-bottom: 16px;
}

.page-toolbar .page-title {
    margin-bottom: 0;
}

.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #1f2937;
}

.card-body {
    padding: 20px;
}

.admin-list-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0;
}

.admin-list-card .card-body.admin-list-body {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.admin-list-scroll {
    flex: 1;
    min-height: 420px;
    overflow: auto;
}

.admin-list-scroll .table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f9fafb;
}

.admin-list-footer {
    flex-shrink: 0;
    padding: 12px 16px;
    border-top: 1px solid #eef0f3;
    background: #fff;
}

.admin-list-body .empty-state,
.admin-list-body .detail-empty {
    flex: 1;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-split .card-table-wrap {
    min-height: 300px;
    max-height: 360px;
    overflow: auto;
}

.dashboard-split .card-table-wrap .admin-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f9fafb;
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* 统计卡片（通用页） */
.metric-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.metric-summary-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-summary-card {
    position: relative;
    min-height: 132px;
    padding: 16px 18px;
    color: #fff;
    overflow: hidden;
    border-radius: 0;
}

.metric-summary-title {
    font-size: 13px;
    opacity: 0.92;
    margin-bottom: 10px;
}

.metric-summary-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 8px;
    word-break: break-all;
}

.metric-summary-grid-5 .metric-summary-value {
    font-size: 26px;
}

.metric-summary-amount {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 6px;
    opacity: 0.95;
}

.metric-summary-desc {
    font-size: 12px;
    opacity: 0.82;
}

.metric-summary-icon {
    position: absolute;
    right: 14px;
    bottom: 10px;
    opacity: 0.18;
}

.metric-summary-svg {
    width: 42px;
    height: 42px;
    display: block;
}

.metric-blue { background: #4a90e2; }
.metric-green { background: #67c23a; }
.metric-orange { background: #e6a23c; }
.metric-purple { background: #5e5cc6; }
.metric-pink { background: #b346b1; }
.metric-slate { background: #6b7280; }
.metric-red { background: #ef4444; }

.admin-form-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
}

.admin-form-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.admin-form-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.admin-form-modal-dialog {
    position: relative;
    width: 520px;
    max-width: 100%;
    margin: 0;
    background: #fff;
    border-radius: 0;
    border: 1px solid #e5e7eb;
}

.admin-form-modal-dialog-wide {
    width: 680px;
}

.admin-modal-tip {
    margin: 0 0 12px;
    font-size: 13px;
    color: #6b7280;
}

.is-hidden {
    display: none !important;
}

.admin-form-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eef0f3;
}

.admin-form-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.admin-form-modal-close {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.admin-form-modal-close:hover {
    color: #374151;
}

.admin-form-modal-body {
    padding: 20px;
}

.admin-form-modal-body .form-group {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.admin-form-modal-body .form-group:last-child {
    margin-bottom: 0;
}

.admin-form-modal-body .form-inline-label,
.admin-profile-modal-body .form-inline-label,
.follow-compose-form .form-inline-label {
    width: 88px;
    flex-shrink: 0;
    text-align: right;
    padding-top: 9px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    line-height: 1.4;
}

.admin-form-modal-body .form-field-body,
.admin-profile-modal-body .form-field-body,
.follow-compose-form .form-field-body {
    flex: 1;
    min-width: 0;
}

.admin-profile-modal-body .form-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.admin-profile-modal-body .form-group:last-child {
    margin-bottom: 0;
}

.follow-compose-form .form-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.follow-compose-form .form-inline-label {
    width: 72px;
    padding-top: 8px;
}

.admin-form-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 20px;
    border-top: 1px solid #eef0f3;
}

.admin-form-modal .form-control,
.admin-form-modal select.form-control {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.table-time-cell {
    white-space: nowrap;
    color: #4b5563;
    font-size: 13px;
}

body.admin-modal-open {
    overflow: hidden;
}

.settings-inline-form .form-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.settings-inline-form .form-field-body {
    flex: 1;
    min-width: 0;
    max-width: 520px;
}

.settings-inline-form .form-control,
.settings-inline-form .system-logo-preview {
    width: 100%;
    max-width: none;
}

.settings-form-page .form-group {
    margin-bottom: 14px;
}

.settings-form-page .form-group:last-child {
    margin-bottom: 0;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageSpinner {
    to {
        transform: rotate(360deg);
    }
}

body.login-page.page-enter .login-page-shell {
    animation: pageFadeIn 0.28s ease;
}

.page-transition-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    z-index: 200000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.24s ease, visibility 0.24s ease;
}

body.page-leaving .page-transition-overlay {
    opacity: 1;
    visibility: visible;
}

.page-transition-content {
    text-align: center;
}

.page-transition-spinner {
    width: 30px;
    height: 30px;
    margin: 0 auto 12px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: pageSpinner 0.8s linear infinite;
}

.page-transition-text {
    font-size: 14px;
    color: #4b5563;
}

.login-icp-link,
.content-icp-link {
    font-size: 12px;
    text-decoration: none;
}

.login-icp-link {
    color: #909399;
}

.login-icp-link:hover {
    color: #409eff;
    text-decoration: underline;
}

.data-preview-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.data-preview-chart-card .card-body {
    min-height: 320px;
}

.data-preview-chart-card canvas {
    width: 100% !important;
    height: 280px !important;
}

/* 表格 */
.table,
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td,
.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eef0f3;
    font-size: 14px;
}

.table th,
.admin-table th {
    font-weight: 600;
    background: #f9fafb;
    color: #4b5563;
}

.table tr:hover,
.admin-table tbody tr:hover {
    background: #f9fbff;
}

.table a,
.admin-table a {
    color: #2563eb;
    text-decoration: none;
}

.table a.btn,
.admin-table a.btn,
.table a.action-link,
.admin-table a.action-link,
.card-header a.btn,
.card-header-actions a.btn {
    text-decoration: none;
}

.table a.btn-primary,
.admin-table a.btn-primary,
.table a.action-link-primary,
.admin-table a.action-link-primary,
.card-header a.btn-primary,
.card-header a.btn-danger {
    color: #fff !important;
    font-weight: 600;
    text-decoration: none;
}

.table a.btn-danger,
.admin-table a.btn-danger,
.card-header a.btn-danger {
    color: #fff !important;
}

.table a.action-link-neutral,
.admin-table a.action-link-neutral {
    color: #4b5563 !important;
}

.table a.action-link-delete,
.admin-table a.action-link-delete {
    color: #fff !important;
}

.table a:hover,
.admin-table a:hover {
    text-decoration: underline;
}

.table a.btn:hover,
.admin-table a.btn:hover,
.table a.action-link:hover,
.admin-table a.action-link:hover,
.card-header a.btn:hover {
    text-decoration: none;
}

/* 搜索表单 */
.search-form,
.customer-search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    margin-bottom: 16px;
    padding: 16px 18px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border: none;
    flex-shrink: 0;
}

.search-form .form-group,
.customer-search-form .form-group {
    margin-bottom: 0;
    flex: 0 0 auto;
    flex-grow: 0;
    width: auto;
    max-width: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.search-form .form-inline-label,
.customer-search-form .form-inline-label {
    display: inline-block;
    flex-shrink: 0;
    min-width: auto;
    width: auto;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.search-form .form-field-body,
.customer-search-form .form-field-body {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
}

.search-form .form-field-body .form-control,
.search-form .form-field-body select.form-control,
.customer-search-form .form-control,
.customer-search-form select.form-control {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    padding: 8px 10px;
    height: 34px;
    border-radius: var(--control-radius, 4px);
}

.search-field-id .form-control,
.search-field-name .form-control {
    width: 120px;
}

.search-field-select .form-control {
    width: 132px;
}

.search-field-phone .form-control {
    width: 148px;
}

.search-field-email .form-control {
    width: 180px;
}

.search-field-keyword .form-control,
.customer-search-form .search-keyword-group .form-control {
    width: 180px;
}

.search-field-md .form-control {
    width: 148px;
}

.search-form-actions,
.customer-search-form .search-form-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    flex-shrink: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
    margin-left: 0;
}

.search-form-actions--end {
    margin-left: 0;
}

.search-form-spacer {
    flex: 1 1 auto;
    min-width: 16px;
    height: 1px;
}

.search-form .form-field-body .form-control::placeholder,
.customer-search-form .form-control::placeholder {
    color: #9ca3af;
}

.search-form .search-form-actions .btn,
.customer-search-form .search-form-actions .btn,
.search-form > .btn {
    align-self: center;
    width: auto;
    min-width: 0;
    height: 34px;
    padding: 0 16px;
    line-height: 1;
    border-radius: var(--control-radius, 4px);
}

body.admin-body .form-control,
body.admin-body select,
body.admin-body textarea,
body.admin-body input:not([type='checkbox']):not([type='radio']):not([type='hidden']):not([type='file']),
body.admin-body .btn,
body.admin-body .pagination a,
body.admin-body .action-link,
body.admin-body .search-form .form-control,
body.admin-body .search-form select.form-control {
    border-radius: var(--control-radius, 4px);
}

body.admin-body .alert {
    border-radius: var(--control-radius);
}

body.admin-body .form-label {
    display: none;
}

.settings-inline-form .form-inline-label {
    display: inline-block;
    width: 88px;
    flex-shrink: 0;
    text-align: right;
    padding-top: 9px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.settings-inline-form .form-group-actions .form-inline-label {
    visibility: hidden;
}

body.admin-body .invalid-feedback,
body.admin-body .watermark {
    padding-left: 0;
}

body.admin-body .permission-item > span,
body.admin-body .column-picker-panel label span,
body.admin-body .search-field-checkbox + span {
    display: inline;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    border-radius: var(--control-radius, 4px);
    text-decoration: none;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    -webkit-font-smoothing: antialiased;
}

.action-link-primary,
.action-link-edit {
    background: #1ab394;
    color: #fff !important;
    font-weight: 600;
}

.action-link-primary:hover,
.action-link-edit:hover {
    background: #18a689;
    color: #fff !important;
}

.action-link-neutral {
    background: #3b82f6;
    color: #fff !important;
    border: none;
}

.action-link-neutral:hover {
    background: #2563eb;
    color: #fff !important;
}

.action-link-delete {
    background: #d93030;
    color: #fff !important;
    border: none;
}

.action-link-delete:hover {
    background: #b91c1c;
    color: #fff !important;
}

body.admin-body .btn-secondary {
    background-color: #fff;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

body.admin-body .btn-secondary:hover {
    background-color: #f9fafb;
    color: #374151;
}

body.admin-body .card-header {
    border-radius: 0;
}

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

    .metric-item:nth-child(2) {
        border-right: none;
    }

    .metric-item:nth-child(odd) {
        border-right: 1px solid #f0f0f0;
    }

    .welcome-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .welcome-stats {
        width: 100%;
        justify-content: space-around;
    }

    .dashboard-split {
        grid-template-columns: 1fr;
    }

    .dashboard-page .dashboard-split {
        grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    }

    body:not(.sidebar-collapsed) .dashboard-page .dashboard-split .dashboard-card:last-child .card-chart-wrap {
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: 16px;
    }

    body.sidebar-collapsed .dashboard-page .dashboard-split .dashboard-card:last-child .card-chart-wrap {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 16px;
    }

    .dashboard-chart-canvas-wrap {
        margin: 0 auto;
    }

    .data-preview-charts {
        grid-template-columns: 1fr;
    }

    .metric-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        min-width: 0;
        height: auto;
    }

    body.sidebar-collapsed .sidebar-brand-text,
    body.sidebar-collapsed .sidebar-search,
    body.sidebar-collapsed .menu-text {
        display: block;
    }

    body.sidebar-collapsed .sidebar-menu a {
        justify-content: flex-start;
        padding-left: 14px;
        padding-right: 14px;
    }

    body.sidebar-collapsed .sidebar-toggle-collapse {
        display: inline-flex;
    }

    body.sidebar-collapsed .sidebar-toggle-expand {
        display: none;
    }

    .main-content {
        padding: 16px;
    }

    .metric-row {
        grid-template-columns: 1fr;
    }

    .metric-item {
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
    }

    .metric-item:last-child {
        border-bottom: none;
    }

    .welcome-stats {
        gap: 16px;
    }
}


/* 状态标签 */
.status-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 6px;
    font-size: 11px;
    line-height: 1.3;
    border-radius: 3px;
    border: none;
    font-weight: 500;
    vertical-align: middle;
}

.status-tag.stage-badge {
    min-width: 44px;
    height: 18px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 500;
    line-height: 18px;
    border-radius: 3px;
    border: none;
    white-space: nowrap;
    box-shadow: none;
    letter-spacing: 0;
}

.status-success {
    background-color: #3d9e2e;
    color: #fff;
}

.status-failed {
    background-color: #d93030;
    color: #fff;
}

.status-pending {
    background-color: #c47a17;
    color: #fff;
}

.status-warning {
    background-color: #b8860b;
    color: #fff;
}

.status-tag.stage-badge.stage-default {
    background-color: #6b7280;
    color: #fff;
}

.status-tag.stage-badge.stage-wait {
    background-color: #c47a17;
    color: #fff;
}

.status-tag.stage-badge.stage-active {
    background-color: #1a6fd4;
    color: #fff;
}

.status-tag.stage-badge.stage-delivered {
    background-color: #0f9d8f;
    color: #fff;
}

.status-tag.stage-badge.stage-done {
    background-color: #3d9e2e;
    color: #fff;
}

.project-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.project-file-list a {
    color: #2563eb;
    font-size: 13px;
}

.project-file-upload {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-file-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.project-file-picker-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.project-file-picker-label:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.project-file-input {
    display: none;
}

.project-file-hint {
    font-size: 12px;
    color: #9ca3af;
}

.project-file-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.project-file-preview-item {
    position: relative;
    border: 1px solid #e5e7eb;
    background: #fafbfc;
    padding: 8px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.project-file-preview-item img {
    max-width: 100%;
    max-height: 72px;
    object-fit: contain;
}

.project-file-preview-icon {
    width: auto;
    height: auto;
    background: transparent;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.file-type-icon {
    position: relative;
    width: 48px;
    height: 56px;
    flex-shrink: 0;
}

.file-type-icon__doc {
    display: block;
    width: 48px;
    height: 56px;
}

.file-type-icon__sheet {
    fill: #f8fafc;
    stroke: #dbeafe;
    stroke-width: 1.5;
}

.file-type-icon__fold {
    fill: #e2e8f0;
    stroke: #dbeafe;
    stroke-width: 1.5;
}

.file-type-icon__badge {
    fill: var(--file-type-color, #64748b);
}

.file-type-icon__label {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    min-width: 28px;
    padding: 1px 4px;
    border-radius: 3px;
    background: var(--file-type-color, #64748b);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    letter-spacing: 0.02em;
}

.project-file-preview-name {
    font-size: 12px;
    color: #374151;
    line-height: 1.4;
    word-break: break-all;
}

.project-file-preview-meta {
    font-size: 11px;
    color: #9ca3af;
}

.project-file-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(17, 24, 39, 0.72);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.project-file-preview-remove:hover {
    background: #ef4444;
}

.project-file-preview-link {
    color: #2563eb;
    text-decoration: none;
    font-size: 12px;
}

.project-file-preview-link:hover {
    text-decoration: underline;
}

.project-file-preview-list--readonly {
    margin-top: 0;
}

.project-file-preview-list--readonly .project-file-preview-item {
    width: 96px;
}

.file-preview-page {
    margin: 0;
    background: #f3f4f6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.file-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.file-preview-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    word-break: break-all;
}

.file-preview-actions {
    display: inline-flex;
    gap: 8px;
    flex-shrink: 0;
}

.file-preview-main {
    flex: 1;
    min-height: 0;
    padding: 16px;
}

.file-preview-frame {
    width: 100%;
    height: calc(100vh - 72px);
    border: none;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.file-preview-image-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 72px);
}

.file-preview-image {
    max-width: 100%;
    height: auto;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.file-preview-doc,
.file-preview-sheet {
    max-width: 960px;
    margin: 0 auto;
    background: #fff;
    padding: 24px 28px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    min-height: calc(100vh - 104px);
}

.file-preview-sheet table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.file-preview-sheet th,
.file-preview-sheet td {
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    text-align: left;
}

.file-preview-sheet th {
    background: #f9fafb;
}

.file-preview-loading,
.file-preview-fallback {
    max-width: 720px;
    margin: 40px auto;
    padding: 24px;
    background: #fff;
    text-align: center;
    color: #6b7280;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.rich-editor-wrap {
    width: 100%;
    border: 1px solid #d8dee9;
    background: #fff;
    overflow: hidden;
}

.rich-editor-wrap.is-invalid {
    border-color: #ef4444;
}

.rich-editor-toolbar {
    border-bottom: 1px solid #e5e7eb;
}

.rich-editor-body {
    min-height: 240px;
    height: 280px;
}

.rich-text-content {
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
    word-break: break-word;
}

.rich-text-content p {
    margin: 0 0 10px;
}

.rich-text-content ul,
.rich-text-content ol {
    margin: 0 0 10px;
    padding-left: 1.4em;
}

.rich-text-content h1,
.rich-text-content h2,
.rich-text-content h3,
.rich-text-content h4,
.rich-text-content h5 {
    margin: 0 0 10px;
    font-weight: 600;
}

.rich-text-content a {
    color: #2563eb;
}

.rich-text-content img {
    max-width: 100%;
    height: auto;
}

.status-tag.stage-badge.stage-wait-sales {
    background-color: #c47a17;
    color: #fff;
}

.status-tag.stage-badge.stage-wait-customer {
    background-color: #c2410c;
    color: #fff;
}

.status-tag.stage-badge.stage-writing {
    background-color: #1a6fd4;
    color: #fff;
}

.status-tag.stage-badge.stage-review {
    background-color: #6d28d9;
    color: #fff;
}

.status-tag.stage-badge.stage-stamping {
    background-color: #4f46e5;
    color: #fff;
}

.status-tag.stage-badge.stage-contracted {
    background-color: #3d9e2e;
    color: #fff;
}

.status-tag.stage-badge.stage-signoff {
    background-color: #0f766e;
    color: #fff;
}

.status-tag.stage-badge.stage-declared {
    background-color: #15803d;
    color: #fff;
}

.status-tag.stage-badge.stage-delivered {
    background-color: #0e7490;
    color: #fff;
}

.status-tag.stage-badge.stage-paused {
    background-color: #b8860b;
    color: #fff;
}

.status-tag.stage-badge.stage-cancelled {
    background-color: #d93030;
    color: #fff;
}

/* 水印文字 */
.watermark {
    color: #999;
}

/* 文本颜色 */
.text-danger {
    color: #dc3545;
}

.text-success {
    color: #28a745;
}

/* 分页样式 */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 13px;
    color: #6b7280;
}

.pagination {
    display: flex;
    justify-content: flex-end;
    margin-top: 0;
}

.pagination a {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 3px;
    color: #374151;
    text-decoration: none;
    border: 1px solid #d1d5db;
}

.pagination a:hover {
    background-color: #f3f4f6;
}

.pagination a.active {
    background-color: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.pagination a.disabled {
    color: #9ca3af;
    pointer-events: none;
}

.amount {
    text-align: right;
}

/* 订单详情页 */
.main-content.customer-detail-page-wrap {
    padding: 10px 12px 16px;
}

.customer-detail-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: none;
}

.detail-record-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.project-stage-timeline-panel .detail-panel-body {
    padding: 12px 16px 20px;
}

.stage-timeline-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.stage-timeline-scroll {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
}

.stage-timeline-track {
    display: flex;
    align-items: flex-start;
    width: 100%;
    min-width: 100%;
    padding: 12px 4px 8px;
}

.stage-timeline-step {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
}

.stage-timeline-node-wrap {
    position: relative;
    z-index: 2;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.stage-timeline-node {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #dcdfe6;
    background: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.stage-timeline-line {
    position: absolute;
    top: 17px;
    left: 50%;
    width: 100%;
    height: 3px;
    background: #e4e7ed;
    z-index: 1;
}

.stage-timeline-step--completed .stage-timeline-node {
    background: #409eff;
    border-color: #409eff;
}

.stage-timeline-step--completed .stage-timeline-line {
    background: #409eff;
}

.stage-timeline-step--active .stage-timeline-node {
    width: 24px;
    height: 24px;
    border-width: 3px;
    background: #409eff;
    border-color: #409eff;
    box-shadow: 0 0 0 5px rgba(64, 158, 255, 0.2);
}

.stage-timeline-step--active.stage-timeline-step--stage-paused .stage-timeline-node {
    background: #e6a23c;
    border-color: #e6a23c;
    box-shadow: 0 0 0 5px rgba(230, 162, 60, 0.2);
}

.stage-timeline-step--active.stage-timeline-step--stage-cancelled .stage-timeline-node {
    background: #f56c6c;
    border-color: #f56c6c;
    box-shadow: 0 0 0 5px rgba(245, 108, 108, 0.2);
}

.stage-timeline-step--active.stage-timeline-step--stage-contracted .stage-timeline-node,
.stage-timeline-step--active.stage-timeline-step--stage-declared .stage-timeline-node,
.stage-timeline-step--active.stage-timeline-step--stage-delivered .stage-timeline-node,
.stage-timeline-step--active.stage-timeline-step--stage-signoff .stage-timeline-node {
    background: #67c23a;
    border-color: #67c23a;
    box-shadow: 0 0 0 5px rgba(103, 194, 58, 0.2);
}

.stage-timeline-label {
    font-size: 13px;
    line-height: 1.5;
    color: #909399;
    padding: 0 4px;
    word-break: break-all;
    min-height: 40px;
}

.stage-timeline-step--completed .stage-timeline-label {
    color: #606266;
}

.stage-timeline-step--active .stage-timeline-label {
    color: #303133;
    font-size: 14px;
    font-weight: 600;
}

.stage-timeline-time {
    margin-top: 6px;
    font-size: 12px;
    color: #c0c4cc;
    line-height: 1.3;
}

.detail-record-no {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
}

.detail-record-sub {
    font-size: 13px;
    color: #6b7280;
}

.detail-record-divider {
    margin: 0 8px;
    color: #d1d5db;
}

.detail-record-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(520px, 42%);
    gap: 16px;
    align-items: start;
}

.detail-main-column,
.detail-side-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.detail-panel {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.detail-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    border-bottom: 1px solid #eef0f3;
    background: #fafbfc;
}

.detail-panel-meta {
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
}

.detail-panel-body {
    padding: 4px 20px 12px;
}

.detail-rows {
    margin: 0;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row dt {
    width: 120px;
    flex-shrink: 0;
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
}

.detail-row dd {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 14px;
    color: #111827;
    line-height: 1.6;
    word-break: break-word;
}

.detail-row--block {
    flex-direction: column;
    gap: 8px;
}

.detail-row--block dt {
    width: auto;
}

.detail-row--block dd {
    width: 100%;
}

.detail-row--block .rich-text-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.detail-rows-summary .detail-row dt {
    width: 96px;
}

.follow-timeline {
    max-height: 420px;
    overflow-y: auto;
    padding-top: 4px;
}

.follow-timeline-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f3f4f6;
}

.follow-timeline-item:last-child {
    border-bottom: none;
}

.follow-avatar {
    width: 34px;
    height: 34px;
    display: block;
    object-fit: cover;
    border-radius: 50%;
    background: #f3f4f6;
    flex-shrink: 0;
}

.follow-timeline-content {
    flex: 1;
    min-width: 0;
}

.follow-timeline-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.follow-timeline-user {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.follow-timeline-time {
    font-size: 12px;
    color: #9ca3af;
    flex-shrink: 0;
}

.follow-timeline-text {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.6;
    word-break: break-word;
}

.follow-timeline-text:empty {
    display: none;
}

.follow-attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.follow-attachment-item {
    max-width: 100%;
}

.follow-attachment-image {
    display: block;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
}

.follow-attachment-image img {
    display: block;
    max-width: 160px;
    max-height: 120px;
    object-fit: cover;
}

.follow-attachment-file {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #374151;
    text-decoration: none;
    max-width: 100%;
}

.follow-attachment-file .file-type-icon {
    width: 40px;
    height: 46px;
}

.follow-attachment-file .file-type-icon__doc {
    width: 40px;
    height: 46px;
}

.follow-attachment-file .file-type-icon__label {
    bottom: 8px;
    font-size: 8px;
}

.follow-attachment-file:hover {
    border-color: #cbd5e1;
    background: #f3f4f6;
}

.follow-attachment-file-name {
    font-size: 12px;
    word-break: break-all;
}

.follow-compose-form .follow-attachment-upload {
    margin-top: 0;
}

.follow-compose-form .project-file-preview-list {
    margin-top: 8px;
}

.follow-compose-form .project-file-preview-item {
    width: 92px;
}

.follow-timeline-status {
    margin-top: 8px;
}

.detail-empty {
    padding: 28px 0;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

.follow-compose-form .form-group {
    margin-bottom: 12px;
}

.follow-compose-input {
    min-height: 96px;
    resize: vertical;
}

.follow-compose-actions {
    display: flex;
    justify-content: flex-end;
}

.detail-follow-panel {
    min-height: 240px;
}

.detail-compose-panel .detail-panel-body {
    padding-top: 12px;
}

.customer-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.info-item {
    margin-bottom: 15px;
}

.info-label {
    font-weight: 500;
    margin-bottom: 5px;
    color: #666;
}

.info-value {
    font-size: 16px;
}

@media (max-width: 1100px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .follow-timeline {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .stage-timeline-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .project-stage-timeline-panel .detail-panel-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .stage-timeline-track {
        min-width: 880px;
    }

    .stage-timeline-step {
        flex: 0 0 80px;
        min-width: 80px;
    }

    .detail-row {
        flex-direction: column;
        gap: 4px;
    }

    .detail-row dt {
        width: auto;
    }
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    margin-right: 5px;
    margin-bottom: 5px;
    background-color: #e9ecef;
    font-size: 12px;
}

/* 响应式布局 */
@media (max-width: 576px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
}
