.theme-edit-timing {
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.7;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}
.theme-edit-timing p { margin: 0 0 4px; }
.theme-edit-expiry { color: #374151; }
.theme-edit-reset-time { color: #166534; font-variant-numeric: tabular-nums; }
.theme-edit-reset-warning {
    color: #374151;
    font-weight: 500;
    line-height: 1.8;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.theme-edit-reset-warning .theme-edit-danger-word { color: #b91c1c; font-weight: 700; text-decoration: none; }
.theme-edit-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(17, 24, 39, 0.55);
}
.theme-edit-confirm {
    width: min(100%, 440px);
    max-height: 90vh;
    overflow: auto;
    border-radius: 8px;
    padding: 24px;
    background: #fff;
    color: #374151;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.2);
}
.theme-edit-confirm h2 { font-size: 20px; font-weight: 600; margin: 0 0 14px; letter-spacing: 0; }
.theme-edit-confirm p { font-size: 14px; line-height: 1.7; margin: 0 0 24px; }
.theme-edit-confirm-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.theme-edit-confirm-actions button {
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    color: #374151;
}
.theme-edit-confirm-actions [data-reset-confirm] { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.theme-edit-confirm button:focus-visible, .theme-edit-browser-gate button:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
}
.theme-edit-browser-gate {
    width: min(100%, 600px);
    padding: 64px 24px 32px;
    margin: 0 auto;
    letter-spacing: 0;
    color: #374151;
    overflow-wrap: anywhere;
}
.theme-edit-browser-site { font-weight: 600; color: #2563eb; margin-bottom: 16px; }
.theme-edit-browser-gate h1 { font-size: 28px; line-height: 1.3; font-weight: 700; margin: 0 0 20px; letter-spacing: 0; }
.theme-edit-browser-context { margin: 0 0 16px; }
.theme-edit-browser-gate ol { list-style: decimal; margin: 0 0 28px; padding-left: 22px; line-height: 1.8; }
.theme-edit-browser-gate label { display: block; font-size: 13px; margin-bottom: 8px; }
.theme-edit-browser-gate input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #374151;
    font-size: 14px;
}
.theme-edit-browser-copy {
    min-height: 42px;
    margin-top: 12px;
    padding: 9px 16px;
    border-radius: 4px;
    color: #fff;
    background: #2563eb;
    font-size: 14px;
}
.theme-edit-browser-status { min-height: 48px; margin-top: 16px; font-size: 13px; color: #166534; }
.theme-edit-load-error { margin: 40px 24px; color: #b91c1c; }

.theme-edit-ticket-hint {
    margin: -8px 0 18px;
    padding: 10px 12px;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
    line-height: 1.6;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.theme-edit-menu-item {
    min-height: 34px;
    white-space: nowrap;
}

.theme-edit-menu-link {
    display: flex;
    width: 100%;
    min-height: 34px;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.theme-edit-dialog-open {
    overflow: hidden;
}

.theme-edit-dialog-overlay {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(17, 24, 39, 0.58);
}

.theme-edit-dialog-overlay[hidden] {
    display: none;
}

.theme-edit-dialog {
    display: flex;
    width: min(100%, 460px);
    max-height: min(84vh, 760px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    box-shadow: 0 18px 48px rgba(17, 24, 39, 0.24);
}

.theme-edit-dialog-notice .theme-edit-dialog {
    width: min(100%, 680px);
}

.theme-edit-dialog-header,
.theme-edit-dialog-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    padding: 14px 18px;
}

.theme-edit-dialog-header {
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
}

.theme-edit-dialog-header h2 {
    margin: 0;
    color: #111827;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
}

.theme-edit-dialog-close {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #4b5563;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
}

.theme-edit-dialog-close:hover,
.theme-edit-dialog-close:focus-visible {
    background: #f3f4f6;
    color: #111827;
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

.theme-edit-dialog-body {
    min-height: 0;
    overflow: auto;
    padding: 18px;
    overscroll-behavior: contain;
}

.theme-edit-dialog-footer {
    justify-content: flex-end;
    border-top: 1px solid #e5e7eb;
}

.theme-edit-dialog-confirm {
    min-width: 88px;
    min-height: 36px;
    border: 1px solid #1d4ed8;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
}

.theme-edit-dialog-confirm:hover,
.theme-edit-dialog-confirm:focus-visible {
    background: #1d4ed8;
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.theme-edit-qr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.theme-edit-qr-code {
    display: flex;
    width: 256px;
    min-height: 256px;
    align-items: center;
    justify-content: center;
    padding: 8px;
    overflow: hidden;
    border: 1px solid #d1d5db;
    background: #fff;
}

.theme-edit-qr-code canvas,
.theme-edit-qr-code img {
    display: block;
    width: 240px;
    height: 240px;
    max-width: 100%;
    object-fit: contain;
}

.theme-edit-qr-error {
    color: #b91c1c;
    text-align: center;
}

.theme-edit-sensitive-note {
    margin: 0;
    color: #b45309;
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}

.theme-edit-notice-list {
    display: grid;
    gap: 22px;
}

.theme-edit-notice-article + .theme-edit-notice-article {
    padding-top: 22px;
    border-top: 1px solid #e5e7eb;
}

.theme-edit-notice-article > h3 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0;
}

.theme-edit-notice-article > time {
    display: block;
    margin-top: 14px;
    color: #6b7280;
    font-size: 12px;
}

.theme-edit-notice-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 360px;
    margin: 0 auto 14px;
    object-fit: contain;
}

.theme-edit-rich-html {
    overflow-wrap: anywhere;
    color: #374151;
    font-size: 14px;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
}

.theme-edit-rich-html > :first-child {
    margin-top: 0;
}

.theme-edit-rich-html > :last-child {
    margin-bottom: 0;
}

.theme-edit-rich-html p,
.theme-edit-rich-html ul,
.theme-edit-rich-html ol,
.theme-edit-rich-html blockquote,
.theme-edit-rich-html pre,
.theme-edit-rich-html table,
.theme-edit-rich-html figure,
.theme-edit-rich-html details {
    margin: 0 0 12px;
    white-space: normal;
}

.theme-edit-rich-html h1,
.theme-edit-rich-html h2,
.theme-edit-rich-html h3,
.theme-edit-rich-html h4,
.theme-edit-rich-html h5,
.theme-edit-rich-html h6 {
    margin: 18px 0 8px;
    color: #111827;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0;
}

.theme-edit-rich-html h1 { font-size: 22px; }
.theme-edit-rich-html h2 { font-size: 20px; }
.theme-edit-rich-html h3 { font-size: 18px; }
.theme-edit-rich-html h4,
.theme-edit-rich-html h5,
.theme-edit-rich-html h6 { font-size: 16px; }

.theme-edit-rich-html ul,
.theme-edit-rich-html ol {
    padding-left: 24px;
}

.theme-edit-rich-html ul { list-style: disc; }
.theme-edit-rich-html ol { list-style: decimal; }
.theme-edit-rich-html li + li { margin-top: 4px; }

.theme-edit-rich-html a {
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.theme-edit-rich-html img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 560px;
    margin: 10px auto;
    object-fit: contain;
}

.theme-edit-rich-html blockquote {
    padding: 10px 14px;
    border-left: 4px solid #60a5fa;
    background: #f8fafc;
    color: #4b5563;
}

.theme-edit-rich-html code,
.theme-edit-rich-html kbd {
    border-radius: 4px;
    background: #f3f4f6;
    color: #9f1239;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.92em;
}

.theme-edit-rich-html code { padding: 2px 5px; }

.theme-edit-rich-html pre {
    padding: 12px 14px;
    overflow-x: auto;
    border: 1px solid #d1d5db;
    background: #111827;
    color: #f9fafb;
    line-height: 1.6;
}

.theme-edit-rich-html pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

.theme-edit-rich-html table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.theme-edit-rich-html th,
.theme-edit-rich-html td {
    min-width: 90px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    text-align: left;
    vertical-align: top;
    white-space: normal;
}

.theme-edit-rich-html th {
    background: #f3f4f6;
    color: #111827;
    font-weight: 600;
}

.theme-edit-rich-html hr {
    margin: 18px 0;
    border: 0;
    border-top: 1px solid #d1d5db;
}

.theme-edit-rich-html mark {
    padding: 1px 3px;
    background: #fef08a;
    color: #713f12;
}

.theme-edit-rich-html details {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.theme-edit-rich-html summary {
    cursor: pointer;
    color: #111827;
    font-weight: 600;
}

@media (max-width: 520px) {
    .theme-edit-dialog-overlay {
        align-items: flex-end;
        padding: 10px;
    }

    .theme-edit-dialog {
        width: 100%;
        max-height: 88vh;
    }

    .theme-edit-dialog-header,
    .theme-edit-dialog-footer {
        padding: 12px 14px;
    }

    .theme-edit-dialog-body {
        padding: 14px;
    }

    .theme-edit-qr-code {
        width: min(256px, 100%);
        min-height: 0;
        aspect-ratio: 1;
    }
}

/* Theme Edit 1.4 v1.4.0: match the existing form, table and button treatment. */
.theme-edit-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px 16px;
    padding: 14px 16px;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 12px;
    letter-spacing: 0;
}
.theme-edit-page-summary { margin-right: auto; font-variant-numeric: tabular-nums; }
.theme-edit-page-size, .theme-edit-page-numbers { display: flex; align-items: center; gap: 4px; }
.theme-edit-page-size { gap: 8px; }
.theme-edit-page-size select { width: 88px; height: 34px; padding-top: 4px; padding-bottom: 4px; font-size: 12px; }
.theme-edit-page-button {
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    color: #6b7280;
    background: #fff;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.theme-edit-page-button .iconfont { font-size: 12px; }
.theme-edit-page-prev { display: inline-block; transform: rotate(90deg); }
.theme-edit-page-next { display: inline-block; transform: rotate(-90deg); }
.theme-edit-page-button:hover:not(:disabled) { border-color: #a5b4fc; color: #6366f1; }
.theme-edit-page-button.is-current { border-color: #6366f1; color: #fff; background: #6366f1; }
.theme-edit-page-button:disabled { opacity: 0.45; cursor: not-allowed; }
.theme-edit-page-button:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }
.theme-edit-page-gap { width: 16px; text-align: center; }
.theme-edit-empty-orders { padding: 24px 16px; text-align: center; color: #9ca3af; font-size: 13px; }
.theme-edit-password-form { margin-top: 20px; }
.theme-edit-password-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.theme-edit-password-field { min-width: 0; }
.theme-edit-password-field input { width: 100%; min-width: 0; }
.theme-edit-password-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.theme-edit-password-actions button { min-height: 38px; flex-shrink: 0; }
.theme-edit-password-actions button:disabled { cursor: wait; opacity: 0.6; }
.theme-edit-password-error { color: #dc2626; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.theme-edit-node-tags { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px 0; }
.theme-edit-node-tag.el-tag { height: auto; min-height: 20px; max-width: 100%; white-space: normal; line-height: 1.5; padding: 2px 6px; }
.theme-edit-node-tag .el-tag__content { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 1023px) {
    .theme-edit-password-fields { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .theme-edit-pagination { padding: 12px; gap: 12px; }
    .theme-edit-page-numbers { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
}
@media (max-width: 380px) {
    .theme-edit-page-button { min-width: 28px; height: 30px; padding: 0 4px; }
    .theme-edit-page-numbers { gap: 3px; }
    .theme-edit-page-gap { width: 12px; }
}
