/* Shared UI follows ipa-signer/style.css; these rules bridge legacy certificate views. */
:root { --accent: #007aff; --cert-ink: #202a35; }
[hidden] { display: none !important; }
.cert-shell, .cert-auth { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif !important; -webkit-font-smoothing: antialiased; }
.cert-shell *, .cert-shell *::before, .cert-shell *::after { box-sizing: border-box; }
body.cert-shell { display: block !important; min-height: 100vh; margin: 0; padding: 0 !important; background: #f5f7fb !important; color: var(--admin-ink) !important; overflow-x: clip; font-size: 14px; line-height: 1.5; }
body.cert-shell[data-theme="dark"] { background: #141b28 !important; --admin-ink: #e8eef5; --admin-muted: #9ba9bc; --admin-line: #344157; --admin-canvas: #182131; --admin-panel: #1e293b; }
.cert-shell a { text-decoration: none; }
.cert-shell button { font-family: inherit; }
.cert-shell button:focus-visible, .cert-shell a:focus-visible, .cert-auth a:focus-visible, .cert-auth button:focus-visible { outline: 3px solid #80b7ff; outline-offset: 3px; }
.cert-shell .admin-sidebar { overflow: hidden; }
.cert-sidebar-nav { min-height: 0; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: #344866 transparent; }
.cert-sidebar-nav .admin-nav-label { margin-top: 23px; }
.cert-sidebar-nav .admin-nav-label:first-child { margin-top: 0; }
.cert-shell .admin-brand { flex-shrink: 0; margin-bottom: 27px; }
.cert-shell .admin-brand:hover { color: #fff; }
.cert-shell .admin-brand-mark { flex: 0 0 38px; font-size: 10px; }
.cert-shell .user-sidebar-bottom { flex-shrink: 0; margin-top: 12px; padding-bottom: 0; }
.cert-shell .admin-account-copy strong { max-width: 150px; }
.cert-shell .admin-content { max-width: 1480px; }
.cert-shell .cert-page-body { min-width: 0; }
.cert-shell .cert-page-heading.is-overview { display: none; }
.cert-shell .eyebrow { color: var(--user-blue); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.cert-shell .cert-footer { margin-top: 40px; color: var(--admin-muted); font-size: 11px; text-align: center; }
.cert-shell .cert-footer a { color: inherit; }
.cert-shell .user-mobile-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cert-shell .user-mobile-nav a span { font-size: 10px; line-height: 1.5; }
.cert-shell .cert-overview-panels { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: stretch; gap: 16px; }
.cert-shell .user-panel-card { padding: 24px; }
.cert-shell .user-panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.cert-shell .user-panel-heading h2 { margin: 0; font-size: 15px; font-weight: 700; }
.cert-shell .user-panel-heading > span { font-size: 11px; color: var(--admin-muted); }
.cert-service-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cert-service-grid a { display: flex; align-items: center; gap: 12px; padding: 16px 12px; border: 1px solid var(--admin-line); border-radius: 10px; color: var(--admin-ink); }
.cert-service-grid a:hover { border-color: #a9c3ef; background: var(--user-blue-soft); }
.cert-service-grid svg { width: 21px; height: 21px; fill: none; stroke: #2864d7; stroke-width: 1.7; flex-shrink: 0; }
.cert-service-grid strong, .cert-service-grid small { display: block; }
.cert-service-grid strong { font-size: 12px; margin-bottom: 4px; }
.cert-service-grid small { font-size: 10px; color: var(--admin-muted); }
.cert-service-grid a > span:last-child { margin-left: auto; color: var(--admin-muted); }
.cert-quick-arrow { margin-left: auto; color: var(--admin-muted); }
.cert-announcement { min-height: 126px; font-size: 13px; color: var(--admin-ink); line-height: 1.8; overflow-wrap: anywhere; }
.cert-announcement img { max-width: 100%; }
.cert-empty-notice { padding: 22px 0; color: var(--admin-muted); text-align: center; }
.cert-empty-notice p { font-size: 11px; }
.cert-support-link { display: block; padding-top: 16px; border-top: 1px solid var(--admin-line); color: var(--user-blue); font-size: 12px; }
.cert-resources { margin-top: 20px; }
/* Legacy page containers now fill the workspace rather than simulating a phone. */
.cert-shell .cert-page-body > :is(.ios-settings,.ios-device-list,.dashboard-container,.container,.page-container,.modern-container,.main-container,.appstore-light,.agent-container,.card-container,.kami-container,.app-list,.content-container) { max-width: none !important; width: 100% !important; margin: 0 !important; padding: 0 !important; background: transparent !important; overflow: visible !important; }
.cert-shell .cert-page-body :is(.settings-group,.module-section,.device-summary-section,.search-section,.device-card,.app-item,.info-card,.stat-card,.card-item,.form-section,.api-container) { background: var(--admin-panel) !important; color: var(--admin-ink); border: 1px solid var(--admin-line) !important; border-radius: 14px !important; box-shadow: var(--user-shadow) !important; animation: none !important; }
.cert-shell .device-summary-section { margin-bottom: 22px; padding: 24px !important; }
.cert-shell .stats-row { justify-content: flex-start; gap: 48px; }
.cert-shell .device-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cert-shell .device-card { min-width: 0; margin: 0 !important; }
.cert-shell :is(.actions-row,.toolbar,.btn-row,.button-group) { flex-wrap: wrap; }
.cert-shell .actions-row { justify-content: flex-start; gap: 10px; }
.cert-shell .actions-row .ios-button { width: auto !important; flex: 0 1 auto !important; min-width: 120px; padding: 10px 16px !important; }
.cert-shell :is(.ios-button.primary,.btn-primary,.btn-submit,.search-submit,.submit-btn,.get-btn,.token-copy-btn,.copy-token-btn) { background: #2864d7 !important; color: #fff !important; border-color: #2864d7 !important; border-radius: 8px !important; box-shadow: none !important; }
.cert-shell :is(.ios-button.secondary,.btn-cancel,.token-change-btn,.change-token-btn) { background: var(--admin-panel) !important; color: var(--admin-ink) !important; border: 1px solid var(--admin-line) !important; border-radius: 8px !important; box-shadow: none !important; }
.cert-shell :is(.stat-number,.stat-value,.item-title,.module-title,.app-name,.form-title,.card-title,.section-title,.modal-title,.pc-tit,.form-label) { color: var(--admin-ink) !important; }
.cert-shell :is(.stat-title,.stat-label,.item-subtitle,.token-hint,.app-description,.empty-subtext,.form-description) { color: var(--admin-muted) !important; }
.cert-shell :is(.settings-item,.app-item) { border-color: var(--admin-line) !important; }
.cert-shell :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),textarea,select) { color: var(--admin-ink) !important; background: var(--admin-panel) !important; border: 1px solid var(--admin-line) !important; border-radius: 8px !important; font-size: 14px; min-width: 0; }
.cert-shell :is(input,textarea,select):focus { outline: none; border-color: #2864d7 !important; box-shadow: 0 0 0 3px rgba(40,100,215,.12); }
.cert-shell :is(.token-input,.token-display,.udid-text) { overflow-wrap: anywhere; word-break: break-all; }
.cert-shell .function-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.cert-shell .function-item { background: var(--admin-panel) !important; border-color: var(--admin-line) !important; color: var(--admin-ink); }
.cert-shell .function-item h4 { color: var(--admin-ink); }
.cert-shell .function-item p { color: var(--admin-muted); }
.cert-shell .settings-group { margin-bottom: 20px; overflow: hidden; }
.cert-shell .settings-item { min-height: 70px; padding: 18px 22px !important; background: transparent !important; }
.cert-shell .stats-grid { gap: 16px; margin-bottom: 22px; }
.cert-shell .stat-card { padding: 20px; }
.cert-shell .stat-card::before, .cert-shell .stat-card::after { display: none; }
.cert-shell .stat-value { margin-top: 10px; }
.cert-shell .recharge-modal-content,.cert-shell .password-modal-content,.cert-shell .layui-layer-page,.cert-shell .swal2-popup { color: var(--admin-ink) !important; background: var(--admin-panel) !important; border-radius: 14px !important; }
.cert-shell .recharge-modal-content label,.cert-shell .password-modal-content label { color: var(--admin-ink) !important; }
.cert-shell .layui-layer-title { color: var(--admin-ink) !important; background: var(--admin-canvas) !important; border-color: var(--admin-line) !important; }
.cert-shell .layui-layer-content { color: var(--admin-ink); }
.cert-shell .layer-scroll-content { background: var(--admin-panel) !important; }
.cert-shell .layer-fixed-footer { background: var(--admin-panel) !important; border-color: var(--admin-line) !important; }
.cert-shell :is(.recharge-modal,.password-modal) { z-index: 100; }
.cert-app-toolbar { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.cert-feature-empty { display: flex; min-height: 360px; align-items: center; justify-content: center; flex-direction: column; gap: 14px; padding: 40px 24px; border: 1px solid var(--admin-line); border-radius: 14px; background: var(--admin-panel); text-align: center; box-shadow: var(--user-shadow); }
.cert-feature-empty > svg { width: 56px; height: 56px; padding: 14px; border-radius: 16px; fill: none; stroke: #2864d7; stroke-width: 1.7; background: #eaf1ff; }
.cert-feature-empty h2 { margin: 0; color: var(--admin-ink); font-size: 20px; }
.cert-feature-empty p { max-width: 480px; margin: 0 0 8px; color: var(--admin-muted); font-size: 13px; line-height: 1.8; }
.cert-security-card { max-width: 760px; }
.cert-security-card .field { margin-bottom: 22px; }
.cert-security-card .field-label { display: block; margin-bottom: 8px; color: var(--admin-ink); font-size: 13px; font-weight: 500; }
.cert-security-card .text-input { width: 100%; max-width: 510px; padding: 12px 14px; }
.cert-security-card .cert-security-actions { display: flex; gap: 10px; }
.cert-security-card .form-message { margin: 0 0 16px; font-size: 13px; }
.cert-security-card .form-message.error { color: #d33e48; }
.cert-security-card .form-message.success { color: #17956b; }
.cert-shell :is(.action-button.blue-button,.action-button.action-primary,.action-button.action-info,.softsource-btn-primary,.source-action-btn.primary) { background: #2864d7 !important; color: #fff !important; border-color: #2864d7 !important; box-shadow: none !important; border-radius: 8px !important; }
.cert-shell :is(.action-button.action-success,.softsource-btn-secondary,.action-button.action-primary) { box-shadow: none !important; }
.cert-shell .table-container { overflow-x: auto; }
.cert-shell :is(.softsource-status-card,.source-item,.sidebar-card,.sidebar-card-link-card,.kami-stat-card,.app-card) { background: var(--admin-panel) !important; color: var(--admin-ink); border: 1px solid var(--admin-line) !important; border-radius: 14px !important; box-shadow: var(--user-shadow) !important; }
.cert-shell .welcome-section { display: none; }
.cert-shell .function-action-card { background: var(--admin-canvas) !important; }
.cert-shell .module-header-icon { background: #eaf1ff !important; color: #2864d7 !important; box-shadow: none !important; }
.cert-shell .warning-box,.cert-shell .tip-box { border-radius: 8px; }
.cert-shell .softwaresource-layout { min-width: 0; }
.cert-shell[data-theme="dark"] { --bg-white: #1e293b; --bg-gray: #182131; --border-color: #344157; --text-main: #e8eef5; --text-sub: #9ba9bc; }
.cert-shell[data-theme="dark"] :is(.empty-state-text,.softsource-info-value,.softsource-status-title,.sidebar-card-title) { color: var(--admin-ink) !important; }
.cert-shell .module-section > .module-header { border-bottom: 1px solid var(--admin-line); }
.cert-shell .app-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.cert-shell .app-item { padding: 20px; margin: 0; }
.cert-shell .empty-state { margin: 0; min-height: 310px; padding: 85px 20px; background: var(--admin-panel) !important; border: 1px solid var(--admin-line); border-radius: 14px; text-align: center; }
.cert-shell .empty-text { color: var(--admin-ink); font-size: 18px; margin-bottom: 8px; }
.cert-shell .floating-btn { display: none; }
.cert-shell .empty-record { padding: 45px 20px; color: var(--admin-muted); }
.cert-shell .empty-record .empty-icon { color: #2864d7; }
.cert-shell table { color: var(--admin-ink); background: var(--admin-panel); }
.cert-shell table th { background: var(--admin-canvas); color: var(--admin-muted); }
.cert-shell table td,.cert-shell table th { border-color: var(--admin-line); }
.cert-shell[data-theme="dark"] :is(.type-switch,.p-card,.form-input,.price-card,.card-body,.info-box,.token-info) { background: var(--admin-canvas) !important; color: var(--admin-ink) !important; border-color: var(--admin-line) !important; }
.cert-shell[data-theme="dark"] :is(.function-item:hover,.settings-item:hover,.cert-service-grid a:hover) { background: #243754 !important; }
@font-face { font-family: "Font Awesome 5 Free"; font-style: normal; font-weight: 900; font-display: block; src: url("../fonts/fa-solid-900.woff2") format("woff2"); }
.cert-shell .fas { font-family: "Font Awesome 5 Free"; font-weight: 900; font-style: normal; }
.fa-wallet:before { content: "\f555"; }.fa-shield-alt:before { content: "\f3ed"; }.fa-user-cog:before { content: "\f4fe"; }.fa-file-import:before { content: "\f56f"; }.fa-mobile-alt:before { content: "\f3cd"; }.fa-headset:before { content: "\f590"; }.fa-sign-out-alt:before { content: "\f2f5"; }.fa-sync-alt:before { content: "\f2f1"; }.fa-receipt:before { content: "\f543"; }
/* Authentication preserves the reference project's layout and proportions. */
body.cert-auth { margin: 0; padding: 0; font-size: 16px; }
.cert-auth .container { padding: 0; }
.cert-auth .header-icon svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cert-auth .auth-heading h1 { font-weight: 700; line-height: 1.3; }
.cert-auth .auth-tabs { font-size: 14px; }
.cert-auth .text-input { font-size: 15px; line-height: 1.5; }
.cert-auth .field-label { font-size: 12px; letter-spacing: 0; text-transform: none; }
.cert-auth .field { margin-bottom: 20px; }
.cert-auth .btn { line-height: 1.5; min-height: 50px; }
.cert-auth .cert-auth-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-secondary); font-size: 12px; }
.cert-auth .cert-auth-options input,.cert-auth .cert-remember input { margin-right: 4px; accent-color: var(--accent); }
.cert-auth .cert-auth-options label { font-weight: 400; }
.cert-auth .cert-captcha { display: flex; gap: 12px; align-items: center; }
.cert-auth .cert-captcha input { min-width: 0; flex: 1; width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 12px; }
.cert-auth .cert-captcha img { flex-shrink: 0; cursor: pointer; }
.cert-auth .cert-captcha .btn-captcha { margin: 0; padding: 10px; font-size: 12px; white-space: nowrap; }
.cert-auth-footer { margin: 26px 0 0; font-size: 11px; color: var(--text-secondary); text-align: center; }
.cert-auth .cert-remember { font-size: 12px; color: var(--text-secondary); font-weight: 400; }
.cert-auth #errtips { padding: 12px; border-radius: 10px; margin-bottom: 18px; font-size: 13px; background: var(--error-bg); color: var(--error); }
.cert-auth .hide { display: none !important; }
.cert-auth .btn-success { background: linear-gradient(135deg,var(--accent),#0056b3); }
@media (max-width:1050px) { .cert-shell .cert-overview-panels { grid-template-columns: 1fr; } .cert-shell .device-list,.cert-shell .app-list { grid-template-columns: 1fr; } }
@media (max-width:760px) {
  .cert-shell .admin-menu-toggle { display: grid; }
  .cert-shell .admin-content { padding: 28px 16px 98px; }
  .cert-shell .device-summary-section { padding: 18px !important; }
  .cert-shell .stats-row { gap: 20px; }
  .cert-shell .actions-row .ios-button { flex: 1 1 40% !important; min-width: 0; font-size: 12px; }
  .cert-shell .cert-service-grid { grid-template-columns: 1fr; }
  .cert-shell .function-grid { grid-template-columns: 1fr; }
  .cert-shell .settings-item { padding: 16px !important; }
  .cert-shell .cert-footer { margin-top: 26px; }
  .cert-shell .cert-page-body .container { width: 100%; padding: 0; }
  .cert-shell .cert-page-heading { margin-bottom: 22px; }
  .cert-shell .recharge-modal-content { max-width: 380px !important; }
  .cert-auth .page { padding: 70px 16px 28px; }
  .cert-auth .auth-card { padding: 26px 22px; }
  .cert-auth .top-nav { margin-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } .cert-auth .container { opacity: 1; transform: none; } }
