html[data-theme="a"] {
  --duo-nogo-w: 16vw;
  --duo-nogo-h: 23dvh;
  --duo-fold-half: 12px;
}

html[data-theme="a"] body.cc-app :is(.sc-notice, .profile-message, .sc-opening-coverage-warning):not(:empty) {
  padding: 10px 12px !important;
  border: 1px solid var(--line2) !important;
  border-radius: var(--a-radius-sm) !important;
  background: var(--s2) !important;
  color: var(--t1) !important;
  overflow-wrap: anywhere;
}

html[data-theme="a"] body.cc-app :is(.sc-notice, .profile-message)[data-error="true"]:not(:empty),
html[data-theme="a"] body.cc-app :is(.sc-issue-error, .sc-opening-coverage-warning):not(:empty) {
  color: var(--neg) !important;
  border-inline-start: 3px solid var(--neg) !important;
}

html[data-theme="a"] body.cc-app .sc-notice-success:not(:empty) {
  color: var(--pos) !important;
  border-inline-start: 3px solid var(--pos) !important;
}

html[data-theme="a"] body.cc-app :is(.sc-empty, .sc-card-empty, .sl-empty) {
  padding: 24px 16px;
  color: var(--t2);
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--a-radius-row);
  text-align: center;
}

html[data-theme="a"] body.cc-app :is(.sc-empty, .sc-card-empty, .sl-empty) + .button {
  display: flex;
  width: fit-content;
  margin: 8px auto 0;
}

html[data-theme="a"] body.cc-app .cc-initial-loading {
  background: var(--bg) !important;
  color: var(--t1);
}

html[data-theme="a"] body.cc-app .cc-initial-loading > [role="status"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

html[data-theme="a"] body.cc-app .cc-initial-loading:has(> [role="status"])::after,
html[data-theme="a"] body.cc-app .sc-issuing-loading:not(:empty)::after {
  content: "";
  display: block;
  block-size: var(--a-loading-row, var(--a-row-mobile));
  border: 1px solid var(--line);
  border-radius: var(--a-radius-row);
  background:
    linear-gradient(var(--s3), var(--s3)) 16px 50% / 38px 38px no-repeat,
    linear-gradient(var(--s3), var(--s3)) 68px 38% / 36% 10px no-repeat,
    linear-gradient(var(--s3), var(--s3)) 68px 68% / 22% 8px no-repeat,
    var(--s1);
}

html[data-theme="a"] body.cc-app .sc-issuing-loading:not(:empty)::after { margin-top: 8px; }

html[data-theme="a"] body.cc-app .cc-toasts {
  top: auto;
  bottom: var(--a-feedback-bottom, var(--a-nav-bottom, 16px));
  right: var(--a-nav-right, 16px);
  max-width: min(360px, calc(100vw - 32px));
}

@media (max-width: 760px) {
  html[data-theme="a"] body.cc-app:has(> .cc-mobile-nav:not([hidden])) {
    --a-feedback-bottom: calc(var(--a-nav-bottom, 16px) + 74px);
  }
}

html[data-theme="a"] body.cc-app .cc-toast {
  background: var(--s2);
  color: var(--t1);
  border-color: var(--line2);
  box-shadow: var(--a-shadow-sheet);
  animation-name: csvcc-a-toast-in;
}

html[data-theme="a"] body.cc-app .cc-toast--success { border-inline-start-color: var(--pos); }
html[data-theme="a"] body.cc-app .cc-toast--error { border-inline-start-color: var(--neg); }
html[data-theme="a"] body.cc-app .cc-toast--leaving { transform: translateY(8px); }
@keyframes csvcc-a-toast-in { from { opacity: 0; transform: translateY(8px); } }

html[data-theme="a"] body.cc-app dialog {
  background: var(--s1) !important;
  color: var(--t1) !important;
  border-color: var(--line2) !important;
  color-scheme: dark;
}

html[data-theme="a"] body.cc-app dialog > header :is(h1, h2, h3) { color: var(--t1) !important; }

html[data-theme="a"] body.cc-app dialog::backdrop { background: var(--a-scrim); }
html[data-theme="a"] body.cc-app dialog :is(.button--quiet, summary, input:not([type="checkbox"]), select, textarea) {
  background: var(--s2) !important;
  color: var(--t1) !important;
  border-color: var(--line2) !important;
}

html[data-theme="a"] body.cc-app dialog :is(.sc-dialog-close, .sc-first-profile > header > button, .sl-entry-close) {
  font-size: 0 !important;
  width: 44px;
  min-width: 44px;
  padding-inline: 0;
}

html[data-theme="a"] body.cc-app dialog :is(.sc-dialog-close, .sc-first-profile > header > button, .sl-entry-close)::after {
  content: "×" / "";
  font-size: 24px;
  line-height: 1;
}

html[data-theme="a"][data-layout^="duo-outer"] body.cc-app {
  --a-dialog-top: max(40px, env(safe-area-inset-top, 0px));
  --a-dialog-bottom: var(--a-feedback-bottom, var(--a-nav-bottom, 16px));
}

html[data-theme="a"][data-layout^="duo-outer"] body.cc-app dialog[open] {
  box-sizing: border-box;
  position: fixed;
  inset: var(--a-dialog-top) 0 auto !important;
  width: min(100% - 16px, 560px) !important;
  max-width: 100% !important;
  height: calc(100dvh - var(--a-dialog-top) - var(--a-dialog-bottom)) !important;
  max-height: calc(100dvh - var(--a-dialog-top) - var(--a-dialog-bottom)) !important;
  margin: 0 auto !important;
  border-radius: var(--a-radius-sheet) !important;
  overflow-y: auto;
  overscroll-behavior: contain;
}

html[data-theme="a"][data-layout^="duo-outer"] body.cc-app dialog > :is(header, .ri-drawer-top) {
  display: flex;
  align-items: center;
  touch-action: pan-x;
}

html[data-theme="a"][data-layout^="duo-outer"] body.cc-app dialog > :is(header, .ri-drawer-top) > button:last-child,
html[data-theme="a"][data-layout^="duo-outer"] body.cc-app dialog .ri-drawer-bar > .ri-close {
  order: -1;
  flex-shrink: 0;
}

html[data-theme="a"][data-layout="duo-outer-app"] body.cc-app dialog[open]:not(:has(> :is(header, .ri-drawer-top))) {
  padding-top: max(16px, calc(var(--duo-nogo-h) - var(--a-dialog-top))) !important;
}

html[data-theme="a"][data-layout="duo-outer-app"] body.cc-app dialog[open] > :is(header, .ri-drawer-top) {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  min-height: max(44px, calc(var(--duo-nogo-h) - var(--a-dialog-top)));
  align-items: start;
  justify-content: flex-start;
  background: var(--s1);
  box-shadow: 0 -24px 0 var(--s1);
  padding-inline-end: var(--duo-nogo-w);
}

html[data-theme="a"][data-layout="duo-outer-app"] body.cc-app .cc-initial-loading {
  --a-loading-row: 68px;
  padding-top: var(--duo-nogo-h);
}

html[data-theme="a"][data-layout="duo-inner-landscape"] body.cc-app :is(.cc-toasts, dialog[open]:not(.a-cards-drawer)) {
  max-width: calc(50vw - var(--duo-fold-half) - 2 * var(--a-nav-right)) !important;
}

html[data-theme="a"][data-layout="duo-inner-landscape"] body.cc-app dialog[open]:not(.a-cards-drawer) {
  inset: max(16px, env(safe-area-inset-top, 0px)) var(--a-nav-right) 16px auto !important;
  margin: 0 !important;
  max-height: calc(100dvh - 32px);
}

html[data-theme="a"][data-layout="duo-inner-landscape"] body.cc-app:has(> .cc-mobile-nav:not([hidden])) {
  --a-feedback-bottom: var(--a-nav-bottom, 16px);
}

html[data-theme="a"][data-layout="duo-inner-portrait"] body.cc-app dialog[open]:not(.a-cards-drawer) {
  inset: auto 0 var(--a-feedback-bottom, var(--a-nav-bottom)) !important;
  max-height: calc(50dvh - var(--duo-fold-half) - var(--a-feedback-bottom, var(--a-nav-bottom))) !important;
  margin: 0 auto !important;
}

html[data-theme="a"][data-layout="duo-inner-portrait"] body.cc-app .cc-toasts {
  top: auto;
  max-height: calc(50dvh - var(--duo-fold-half) - var(--a-feedback-bottom, var(--a-nav-bottom)));
}

html[data-theme="a"] body.cc-app :is(dialog.sc-dialog, dialog.sl-dialog, .a-cards-drawer .ri-drawer-top)::before {
  background-color: var(--s3);
  border: 1px solid var(--line2);
}

html[data-theme="a"] body.cc-app .sc-op-dialog .button--primary:not(:disabled) {
  background: var(--lime) !important;
  color: var(--lime-ink) !important;
}

html[data-theme="a"] body.cc-app .sc-op-dialog .button--primary:disabled {
  background: var(--s3) !important;
  color: var(--t2) !important;
}

html[data-theme="a"] body.cc-app .sc-op-dialog :is(h2, .sc-limit-form label) {
  color: var(--t1);
}

html[data-theme="a"] body.cc-app .sc-op-dialog :is(.sc-op-summary, .sc-op-note) {
  color: var(--t2);
}

/* 12-03 开卡稳定 FE15：卡操作结果框在主题 A 下原来退回设计系统的浅色底（米黄、浅红、浅绿），白色标题看不见。
   改成深色底，用边框和正文颜色区分结果：确认中=橙、没提交/失败=红、成功=绿。 */
html[data-theme="a"] body.cc-app .sc-operation-feedback {
  background: var(--s1) !important;
  border-color: var(--line2) !important;
  color: var(--t1) !important;
}
html[data-theme="a"] body.cc-app .sc-operation-feedback :is(h2, h3) { color: var(--t1) !important; }
html[data-theme="a"] body.cc-app .sc-operation-feedback .sc-help { color: var(--t2) !important; }
html[data-theme="a"] body.cc-app .sc-operation-feedback[data-operation-state="unknown"] { border-color: var(--warn) !important; }
html[data-theme="a"] body.cc-app .sc-operation-feedback[data-operation-state="unknown"] .sc-operation-message { color: var(--warn) !important; }
html[data-theme="a"] body.cc-app .sc-operation-feedback:is([data-operation-state="failed"], [data-operation-state="not_submitted"]) { border-color: var(--neg) !important; }
html[data-theme="a"] body.cc-app .sc-operation-feedback:is([data-operation-state="failed"], [data-operation-state="not_submitted"]) .sc-operation-message { color: var(--neg) !important; }
html[data-theme="a"] body.cc-app .sc-operation-feedback[data-operation-state="succeeded"] { border-color: var(--pos) !important; }
html[data-theme="a"] body.cc-app .sc-operation-feedback[data-operation-state="succeeded"] .sc-operation-message { color: var(--pos) !important; }
