* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.login-page {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    background: #f5f7fb;
    color: #1f2937;
}

.login-topbar {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid #eef2f7;
    position: sticky;
    top: 0;
    z-index: 10;
}

.login-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
}

.login-wrap {
    max-width: 420px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.login-brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.login-brand h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-brand p {
    font-size: 13px;
    color: #94a3b8;
}

.login-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
}

.login-tab {
    flex: 1;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
}

.login-tab.active {
    border-color: #667eea;
    color: #667eea;
    background: #f5f7ff;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.input-wrap {
    position: relative;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.form-control::placeholder {
    color: #cbd5e1;
}

.pwd-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px;
}

.captcha-block {
    position: relative;
    margin-bottom: 18px;
}

.captcha-block-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.yidun-mount {
    min-height: 0;
}

.yidun-jigsaw {
    user-select: none;
}

.yidun-jigsaw-panel {
    position: relative;
    width: 320px;
    max-width: 100%;
    height: 160px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.yidun-jigsaw-bg {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yidun-jigsaw-hole {
    position: absolute;
    width: 42px;
    height: 42px;
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.yidun-jigsaw-piece {
    position: absolute;
    left: 0;
    width: 42px;
    height: 42px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.85);
    background-repeat: no-repeat;
    cursor: grab;
    touch-action: none;
    z-index: 2;
}

.yidun-jigsaw-piece:active {
    cursor: grabbing;
}

.yidun-jigsaw-piece.ok {
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.35);
}

.yidun-jigsaw-refresh {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #64748b;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    z-index: 3;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.yidun-slider-bar {
    position: relative;
    height: 40px;
    margin-top: 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.yidun-slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: #d1fae5;
    border-right: 1px solid #6ee7b7;
    pointer-events: none;
}

.yidun-slider-tip {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #94a3b8;
    pointer-events: none;
    padding-left: 40px;
}

.yidun-slider-tip.hidden {
    opacity: 0;
}

.yidun-slider-btn {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    box-shadow: 2px 0 6px rgba(15, 23, 42, 0.08);
    cursor: grab;
    touch-action: none;
    z-index: 2;
    color: #64748b;
}

.yidun-slider-btn.ok {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}

.yidun-captcha-status {
    margin-top: 6px;
    font-size: 12px;
    min-height: 18px;
    color: #64748b;
}

.yidun-captcha-status.ok {
    color: #16a34a;
}

.yidun-captcha-status.err {
    color: #ef4444;
}

.captcha-block.disabled {
    opacity: 0.72;
}

.captcha-agree-mask {
    position: absolute;
    inset: 0;
    top: 28px;
    z-index: 5;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.88);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-align: center;
    cursor: pointer;
    line-height: 1.5;
}

.captcha-agree-mask.is-visible {
    display: flex;
}

.agree-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
    position: relative;
}

.agree-row.highlight {
    border-color: #f87171;
    background: #fef2f2;
    animation: agree-shake 0.45s ease;
}

@keyframes agree-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.agree-row input {
    position: absolute;
    opacity: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.agree-row .agree-check {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
    pointer-events: none;
}

.agree-row input:checked + .agree-check {
    border-color: #667eea;
    background: #667eea;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.agree-row input:checked + .agree-check::after {
    content: '✓';
}

.agree-row.is-checked {
    border-color: #c7d2fe;
    background: #f5f7ff;
}

.agree-row a {
    color: #667eea;
    text-decoration: none;
}

.error-msg {
    color: #ef4444;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}

.error-msg.show {
    display: block;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}

.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.login-footer-links {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #64748b;
}

.login-footer-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.register-tips {
    margin-top: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    font-size: 12px;
    color: #64748b;
}

.register-tips ul {
    padding-left: 18px;
}

.disclaimer-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.45);
}

.disclaimer-modal.show {
    display: flex;
}

.disclaimer-dialog {
    width: min(480px, 100%);
    max-height: min(80vh, 640px);
    background: #fff;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}

.disclaimer-head {
    padding: 16px 18px;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.disclaimer-head h2 {
    font-size: 17px;
}

.disclaimer-close {
    border: none;
    background: #f1f5f9;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #64748b;
}

.disclaimer-body {
    padding: 16px 18px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.7;
    color: #475569;
}

.disclaimer-body h3 {
    font-size: 14px;
    color: #1e293b;
    margin: 14px 0 6px;
}

.disclaimer-body h3:first-child {
    margin-top: 0;
}

.disclaimer-foot {
    padding: 14px 18px;
    border-top: 1px solid #eef2f7;
}

.disclaimer-foot button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #667eea;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.success-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    background: #16a34a;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 1100;
    transition: transform 0.25s ease;
}

.success-toast.show {
    transform: translateX(-50%) translateY(0);
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
