* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    background: linear-gradient(135deg, #eef5ff 0%, #dbeafe 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
}
.container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 94%;
    max-width: 480px;
    padding: 28px 22px 24px;
}
h1 {
    text-align: center;
    color: #1e3a8a;
    font-size: 20px;
    margin-bottom: 8px;
    line-height: 1.4;
}
.sub {
    text-align: center;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 18px;
    line-height: 1.55;
}
.tab-bar {
    display: flex;
    margin-bottom: 18px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e8eaf2;
    background: #f0f2f8;
}
.tab-btn {
    flex: 1;
    padding: 12px 8px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.tab-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    font-weight: 600;
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.notice {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #93c5fd;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.55;
}
.notice.closed {
    background: #fff5f5;
    color: #822727;
    border-color: #feb2b2;
}
.form-group { margin-bottom: 16px; }
label {
    display: block;
    margin-bottom: 8px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
}
input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}
input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
}
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}
.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.hint-field {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
    line-height: 1.45;
}
.query-hint {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 14px;
    line-height: 1.5;
}
.back {
    text-align: center;
    margin-top: 18px;
}
.back a {
    color: #1d4ed8;
    font-size: 14px;
    text-decoration: underline;
}
.msg {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    display: none;
}
.msg.success {
    display: block;
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #9ae6b4;
}
.msg.error {
    display: block;
    background: #fff5f5;
    color: #822727;
    border: 1px solid #feb2b2;
}
.loading {
    display: none;
    text-align: center;
    margin-top: 12px;
    color: #64748b;
    font-size: 14px;
}
.loading.show { display: block; }
.query-result {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.query-result.show { display: block; }
.query-result h3 {
    font-size: 15px;
    color: #1e3a8a;
    margin-bottom: 12px;
}
.ch-pending-notice {
    margin-bottom: 14px;
    padding: 14px 12px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 10px;
}
.ch-pending-notice-title {
    font-size: 14px;
    color: #92400e;
    line-height: 1.65;
    text-align: center;
    font-weight: 600;
}
.ch-error-notice {
    margin-bottom: 14px;
    padding: 14px 12px;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 10px;
}
.ch-error-notice-line {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.65;
    text-align: center;
    font-weight: 600;
}
.ch-error-notice-line + .ch-error-notice-line {
    margin-top: 8px;
}
.ch-em {
    color: #c53030;
    font-weight: 700;
}
.result-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #edf2f7;
    font-size: 13px;
}
.result-item:last-child { border-bottom: none; }
.result-label { color: #64748b; flex-shrink: 0; }
.result-value {
    color: #1e293b;
    text-align: right;
    word-break: break-all;
    font-weight: 500;
}
.result-value.status-pending { color: #b45309; }
.result-value.status-error { color: #c53030; }
.result-value.status-done { color: #22543d; }

#tab-panel-submit.ch-submit-locked .ch-submit-disabled-mask {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 2;
    cursor: not-allowed;
    border-radius: 8px;
}
#tab-panel-submit.ch-submit-locked {
    position: relative;
}
#tab-panel-submit.ch-submit-locked input,
#tab-panel-submit.ch-submit-locked button,
#tab-panel-submit.ch-submit-locked textarea,
#tab-panel-submit.ch-submit-locked select {
    pointer-events: none;
    opacity: 0.55;
}
#tab-panel-submit.ch-submit-locked .notice {
    opacity: 0.55;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.55);
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.modal.is-open {
    display: flex;
}
#chClosedModal .modal-content {
    background: #fff;
    padding: 28px 24px 24px;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    width: 100%;
    max-width: 320px;
    margin: auto;
    position: relative;
    flex-shrink: 0;
}
.modal-content-closed {
    text-align: center;
}
.ch-closed-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 14px;
}
.ch-closed-message {
    color: #334155;
    font-size: 16px;
    line-height: 1.65;
    margin-bottom: 22px;
    white-space: pre-line;
}
.btn-ch-closed-ok {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.btn-ch-closed-ok:active {
    transform: scale(0.98);
}
