body {
    font-family: 'Inter', Arial, sans-serif;
    background: linear-gradient(120deg, #e0eafc 0%, #cfdef3 100%);
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.modal-open {
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 560px;
    margin: 40px auto;
    padding: 20px 12px;
}

h1 {
    text-align: center;
    font-weight: 600;
    color: #2d3a4a;
    margin-bottom: 32px;
    letter-spacing: 1px;
}

.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(44, 62, 80, 0.08);
    padding: 24px 20px 20px 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: box-shadow 0.2s;
}

.card h2 {
    margin: 0 0 12px 0;
    font-size: 1.2rem;
    color: #3a4a5d;
    font-weight: 600;
}

#welcomeText {
    margin: 0;
    font-size: 0.95rem;
    color: #334155;
}

.hint-text {
    margin: -4px 0 4px;
    font-size: 0.88rem;
    color: #64748b;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    font-size: 1rem;
    background: #f8fafc;
    outline: none;
    transition: border 0.2s;
}
input:focus {
    border: 1.5px solid #60a5fa;
}

button {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.06);
}
button:hover {
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
}
button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
}
button.secondary {
    background: #e5e7eb;
    color: #374151;
    box-shadow: none;
}
button.secondary:hover {
    background: #d1d5db;
}

.error {
    color: #ef4444;
    font-size: 0.95rem;
    min-height: 18px;
}

.flow-title {
    margin: 4px 0 2px;
    font-size: 0.96rem;
    color: #334155;
    font-weight: 600;
}

.flow-block {
    border: 1px solid #dbeafe;
    border-radius: 12px;
    padding: 10px;
    background: #f8fbff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.inline-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.inline-row button {
    width: auto;
    flex: 0 0 42%;
    white-space: nowrap;
}

.inline-row input {
    width: auto;
    flex: 1;
    min-width: 0;
}

.captcha-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}

.captcha-dialog {
    width: 100%;
    max-width: 500px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #dbeafe;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.captcha-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.captcha-dialog-head h3 {
    margin: 0;
    font-size: 1rem;
    color: #1e293b;
}

.captcha-close {
    width: auto;
    padding: 8px 14px;
}

.captcha-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}

.captcha-frame {
    width: 100%;
    height: min(78vh, 820px);
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #0f172a;
}

.admin-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    z-index: 1100;
}

.admin-dialog {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #dbeafe;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.admin-dialog-head h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1rem;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-field label {
    font-size: 0.9rem;
    color: #334155;
    font-weight: 600;
}

.admin-actions-row {
    display: flex;
    gap: 10px;
    margin-top: 2px;
}

.admin-actions-row button {
    flex: 1;
}

.admin-form .hint-text {
    margin: 0;
}

.admin-form .hint-text:empty {
    display: none;
}

.admin-form .error {
    margin: 0;
    min-height: 0;
}

.admin-form .error:empty {
    display: none;
}

.result-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    z-index: 1150;
}

.result-dialog {
    width: 100%;
    max-width: 880px;
    max-height: 86vh;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #dbeafe;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.result-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.result-dialog-head h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1rem;
}

#resultModalBox {
    overflow: auto;
    max-height: calc(86vh - 78px);
}

@media (max-width: 560px) {
    .card {
        padding: 18px 14px 14px 14px;
    }

    .inline-row {
        flex-direction: column;
    }

    .inline-row button,
    .inline-row input {
        width: 100%;
        flex: 1 1 auto;
    }

    .admin-actions-row {
        flex-direction: column;
    }

    .result-dialog {
        max-height: 90vh;
    }

    #resultModalBox {
        max-height: calc(90vh - 78px);
    }
}

pre {
    margin: 0;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #dbeafe;
    background: #f8fafc;
    max-height: 320px;
    overflow: auto;
    font-size: 0.86rem;
    line-height: 1.45;
}

.result-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-message {
    margin: 0;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #dbeafe;
    background: #f8fafc;
    color: #1f2937;
}

.result-kv {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 8px 12px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #dbeafe;
    background: #f8fafc;
}

.result-key {
    color: #475569;
    font-weight: 600;
}

.result-val {
    color: #1f2937;
    word-break: break-word;
}

.result-table-wrap {
    overflow-x: auto;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #f8fafc;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.result-table th,
.result-table td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.result-table th {
    background: #e2e8f0;
    color: #1f2937;
    font-weight: 600;
}

.result-table tr:last-child td {
    border-bottom: none;
}

.notice-popup {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    z-index: 1200;
}

.notice-card {
    width: 100%;
    max-width: 360px;
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.2);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.notice-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #1d4ed8;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #93c5fd;
}

.notice-card h3 {
    margin: 0;
    font-size: 1rem;
    color: #0f172a;
}

.notice-card p {
    margin: 0;
    color: #334155;
    font-size: 0.94rem;
    line-height: 1.45;
}

.notice-card button {
    margin-top: 4px;
}

.hidden {
    display: none !important;
}
