/* DTCall unified enterprise UI layer */
:root {
    --dt-bg: #f4f7fb;
    --dt-surface: #ffffff;
    --dt-surface-soft: #f8fbff;
    --dt-border: #e5edf6;
    --dt-border-strong: #d5e3f2;
    --dt-text: #172033;
    --dt-text-secondary: #53647a;
    --dt-text-muted: #8090a6;
    --dt-primary: #1677ff;
    --dt-primary-strong: #0f5bd8;
    --dt-cyan: #06b6d4;
    --dt-success: #16a34a;
    --dt-warning: #d97706;
    --dt-danger: #dc2626;
    --dt-radius: 8px;
    --dt-radius-sm: 6px;
    --dt-shadow-card: 0 10px 28px rgba(37, 99, 235, 0.08);
    --dt-shadow-float: 0 18px 42px rgba(15, 23, 42, 0.14);
    --dt-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html,
body {
    font-family: var(--dt-font);
    color: var(--dt-text);
    background: var(--dt-bg);
}

a {
    color: var(--dt-primary);
}

a:hover {
    color: var(--dt-primary-strong);
}

.layui-fluid {
    padding: 18px;
}

.layui-card {
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius);
    box-shadow: var(--dt-shadow-card);
    overflow: hidden;
}

.layui-card-header {
    min-height: 48px;
    height: auto;
    line-height: 24px;
    padding: 12px 18px;
    color: var(--dt-text);
    font-weight: 700;
    background: linear-gradient(180deg, #ffffff, var(--dt-surface-soft));
    border-bottom: 1px solid var(--dt-border);
}

.layui-card-header h1,
.layui-card-header h2,
.layui-card-header h3 {
    margin: 0;
    font-size: 16px;
    line-height: 24px;
    font-weight: 700;
    color: var(--dt-text);
}

.layui-card-body {
    padding: 18px;
}

.layui-btn {
    border-radius: var(--dt-radius-sm);
    box-shadow: none;
}

.layui-btn:not(.layui-btn-primary):not(.layui-btn-danger):not(.layui-btn-warm) {
    background: linear-gradient(135deg, var(--dt-primary), var(--dt-cyan));
}

.layui-btn-primary {
    border-color: var(--dt-border-strong);
    color: var(--dt-text-secondary);
}

.layui-input,
.layui-select,
.layui-textarea {
    border-color: var(--dt-border-strong);
    border-radius: var(--dt-radius-sm);
}

.layui-input:focus,
.layui-textarea:focus {
    border-color: rgba(22, 119, 255, 0.62) !important;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

.layui-table-view {
    border-color: var(--dt-border);
    border-radius: var(--dt-radius);
    overflow: hidden;
}

.layui-table th {
    background: #f6f9fe;
    color: var(--dt-text-secondary);
    font-weight: 700;
}

.layui-table td,
.layui-table th {
    border-color: #edf2f8;
}

.layui-table tbody tr:hover,
.layui-table-hover {
    background: #f8fbff !important;
}

.layui-laypage .layui-laypage-curr .layui-laypage-em {
    background: var(--dt-primary);
    border-radius: var(--dt-radius-sm);
}

.badge,
.layui-badge {
    border-radius: 999px;
}

.detail-container,
.page-container,
.content-container {
    background: var(--dt-bg);
}

.info-table td:first-child {
    background: #f6f9fe;
    color: var(--dt-text-secondary);
}

.dt-page-shell {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(244, 247, 251, 0.96)),
        radial-gradient(circle at 16% 0%, rgba(22, 119, 255, 0.1), transparent 28%),
        var(--dt-bg);
}

.dt-auth-body,
.dt-error-body {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(238, 247, 255, 0.86)),
        linear-gradient(180deg, #f6faff, #eef5fc);
}

.dt-error-card {
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius);
    box-shadow: var(--dt-shadow-float);
}

.dt-error-icon {
    width: 78px;
    height: 78px;
    margin: 0 auto 18px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(22, 119, 255, 0.12), rgba(6, 182, 212, 0.12));
    color: var(--dt-primary);
    font-size: 42px;
}

.dt-soft-panel {
    background: #f7fbff;
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius);
}

.form-header,
.customer-header,
.designer-header,
.detail-header-gradient,
.detail-header,
.page-hero,
.stat-card.purple,
.stat-card.storage,
.production-stat-card {
    background: linear-gradient(135deg, var(--dt-primary), var(--dt-cyan)) !important;
}

.form-header h1,
.form-header h2,
.form-header h3,
.form-header .subtitle,
.detail-header h1,
.detail-header h2,
.detail-header h3,
.detail-header .subtitle,
.customer-header h1,
.customer-header h2,
.customer-header h3,
.designer-header h1,
.designer-header h2,
.designer-header h3 {
    color: #fff !important;
}

.form-container,
.password-container,
.share-card,
.detail-card,
.info-card {
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius) !important;
    box-shadow: var(--dt-shadow-card) !important;
}

.form-section,
.info-section,
.section-card {
    border-color: var(--dt-border) !important;
    background: #f7fbff !important;
    border-left-color: var(--dt-primary) !important;
    border-radius: var(--dt-radius) !important;
}

.section-title,
.form-section-title,
.detail-title {
    color: var(--dt-text);
}

.section-title i,
.form-section-title i,
.detail-title i {
    color: var(--dt-primary) !important;
}

.form-actions,
.action-buttons,
.layui-form-footer {
    background: #fff !important;
    border-top-color: var(--dt-border) !important;
}

.form-container .layui-btn,
.detail-container .layui-btn,
.layui-form-footer .layui-btn {
    border-radius: var(--dt-radius-sm) !important;
}

.form-container .layui-btn-normal,
.detail-container .layui-btn-normal,
.layui-form-footer .layui-btn:not(.layui-btn-primary):not(.layui-btn-danger):not(.layui-btn-warm) {
    background: linear-gradient(135deg, var(--dt-primary), var(--dt-cyan)) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.form-container .layui-btn-normal:hover,
.detail-container .layui-btn-normal:hover,
.layui-form-footer .layui-btn:hover {
    box-shadow: 0 6px 16px rgba(22, 119, 255, 0.22) !important;
}

.upload-area:hover {
    border-color: var(--dt-primary) !important;
    background: rgba(22, 119, 255, 0.05) !important;
}

.progress-fill {
    background: linear-gradient(90deg, var(--dt-primary), var(--dt-cyan)) !important;
}

[style*="#667eea"],
[style*="#764ba2"] {
    border-color: var(--dt-primary) !important;
}

[style*="linear-gradient(135deg, #667eea"],
[style*="linear-gradient(145deg, #667eea"],
[style*="linear-gradient(90deg, #667eea"],
[style*="linear-gradient(135deg,#667eea"],
[style*="linear-gradient(145deg,#667eea"],
[style*="linear-gradient(90deg,#667eea"] {
    background: linear-gradient(135deg, var(--dt-primary), var(--dt-cyan)) !important;
}

[style*="color: #667eea"],
[style*="color:#667eea"],
[style*="color: #764ba2"],
[style*="color:#764ba2"] {
    color: var(--dt-primary) !important;
}

@media (max-width: 768px) {
    .layui-fluid {
        padding: 12px;
    }

    .layui-card-body {
        padding: 14px;
    }
}


/* ============================================================
   Sidebar Version Footer — online update section
   ============================================================ */
.sidebar-version-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 85px;
    padding: 10px 14px 12px;
    border-top: 1px solid rgba(59, 130, 246, 0.12);
    background: #fff;
    box-shadow: 0 -4px 16px rgba(37, 99, 235, 0.06);
    z-index: 15;
    box-sizing: border-box;
}

.version-info-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.version-label {
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.version-value {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.version-commit {
    font-size: 10px;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    color: #94a3b8;
    background: rgba(148,163,184,0.1);
    padding: 1px 5px;
    border-radius: 4px;
    cursor: default;
}

.version-actions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.version-btn {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.06);
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
    padding: 0;
}

.version-btn:hover {
    background: rgba(22, 119, 255, 0.12);
    color: #1677ff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.14);
    transform: translateY(-1px);
}

.version-btn:active {
    transform: scale(0.94);
}

.version-btn i {
    font-size: 14px;
}

.version-btn-update {
    color: #fff;
    background: linear-gradient(135deg, #1677ff, #0ea5e9);
    box-shadow: 0 4px 14px rgba(22, 119, 255, 0.22);
}

.version-btn-update:hover {
    color: #fff;
    background: linear-gradient(135deg, #0958d9, #0891b2);
    box-shadow: 0 6px 18px rgba(22, 119, 255, 0.28);
}

.version-btn-rollback {
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.18);
    background: rgba(245, 158, 11, 0.06);
}

.version-btn-rollback:hover {
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.32);
    background: rgba(245, 158, 11, 0.12);
}

.version-status {
    margin-top: 4px;
}

.version-status-text {
    font-size: 10px;
    color: #94a3b8;
}

.version-status.has-update .version-status-text {
    color: #1677ff;
    font-weight: 600;
}

/* Update progress overlay */
.update-progress-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.update-progress-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px 40px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
    text-align: center;
}

.update-progress-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.update-progress-card .update-step {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
}

.update-progress-card .layui-progress {
    margin: 16px 0;
}

.update-progress-card .update-log {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 12px;
    max-height: 80px;
    overflow-y: auto;
    text-align: left;
}

/* Spin animation for check update button */
@keyframes versionSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.version-btn-check.checking i {
    animation: versionSpin 0.8s linear infinite;
}

/* Pulse for update available */
@keyframes versionPulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(22, 119, 255, 0.22); }
    50% { box-shadow: 0 4px 24px rgba(22, 119, 255, 0.42); }
}

.version-btn-update.has-update {
    animation: versionPulse 2s ease-in-out infinite;
}

/* Responsive: collapse version footer on narrow screens */
@media (max-width: 900px) {
    .sidebar-version-footer {
        text-align: center;
    }
    .version-info-row {
        justify-content: center;
    }
    .version-commit {
        display: none;
    }
    .version-actions {
        justify-content: center;
    }
}


/* ============================================================
   Version status link (clickable for changelog)
   ============================================================ */
.version-status-link {
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
}

.version-status-link:hover .version-status-text {
    color: #0958d9;
    text-decoration: underline;
}

.version-status-text.has-update {
    color: #1677ff;
    font-weight: 600;
}

/* ============================================================
   Changelog Modal
   ============================================================ */
.changelog-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
}

.changelog-modal {
    background: #fff;
    border-radius: 16px;
    width: 520px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.changelog-header {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 85px;padding: 20px 24px 14px;
    border-bottom: 1px solid #eef2f6;
    flex-shrink: 0;
}

.changelog-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.changelog-header h3 i {
    font-size: 20px;
    color: #1677ff;
}

.changelog-version-tag {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #1677ff, #0ea5e9);
    padding: 2px 10px;
    border-radius: 99px;
    letter-spacing: 0.04em;
}

.changelog-close {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.changelog-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.changelog-close i {
    font-size: 16px;
}

.changelog-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    min-height: 120px;
    max-height: 50vh;
}

.changelog-loading,
.changelog-empty {
    text-align: center;
    color: #94a3b8;
    padding: 32px 0;
    font-size: 13px;
}

.changelog-loading i {
    font-size: 20px;
    margin-right: 6px;
    vertical-align: middle;
}

/* Changelog list */
.changelog-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.changelog-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    transition: background 0.15s;
}

.changelog-item:hover {
    background: #f8fafc;
}

.changelog-item + .changelog-item {
    margin-top: 2px;
}

.changelog-item-new {
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.changelog-item-new:hover {
    background: linear-gradient(135deg, #e0f0ff, #e6f6ff);
}

.changelog-hash {
    flex-shrink: 0;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    color: #1677ff;
    background: rgba(22, 119, 255, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    line-height: 20px;
}

.changelog-msg {
    font-size: 13px;
    color: #334155;
    line-height: 20px;
    word-break: break-word;
}

.changelog-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 14px 24px 20px;
    border-top: 1px solid #eef2f6;
    flex-shrink: 0;
}

.changelog-btn {
    border: 0;
    border-radius: 10px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.changelog-btn:active {
    transform: scale(0.97);
}

.changelog-btn-update {
    background: linear-gradient(135deg, #1677ff, #0ea5e9);
    color: #fff;
    box-shadow: 0 4px 14px rgba(22, 119, 255, 0.22);
}

.changelog-btn-update:hover {
    box-shadow: 0 6px 20px rgba(22, 119, 255, 0.32);
}

.changelog-btn-close {
    background: #f1f5f9;
    color: #475569;
}

.changelog-btn-close:hover {
    background: #e2e8f0;
}

/* Responsive */
@media (max-width: 640px) {
    .changelog-modal {
        width: 96vw;
        max-height: 85vh;
        border-radius: 12px;
    }
    .changelog-header {
        padding: 16px 18px 12px;
    }
    .changelog-body {
        padding: 12px 18px;
    }
    .changelog-footer {
        padding: 12px 18px 16px;
    }
}



