/**
 * 喜木·爻机 — 独立注册页样式（与六爻起卦页色系一致）
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: linear-gradient(165deg, #dceee4 0%, #c8e2d2 40%, #b2d4c4 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #333;
}

.skip-to-main {
    position: absolute;
    left: 0;
    top: -100px;
    z-index: 100003;
    padding: 10px 16px;
    background: #2a6350;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.skip-to-main:focus {
    top: 0;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

#main-content:focus {
    outline: 2px solid #2f6b52;
    outline-offset: 2px;
}

.register-container {
    background: #fff;
    border-radius: 16px;
    box-shadow:
        0 4px 6px rgba(26, 61, 50, 0.08),
        0 16px 40px rgba(26, 61, 50, 0.12);
    border: 1px solid rgba(47, 107, 82, 0.12);
    padding: 40px;
    width: 100%;
    max-width: 500px;
}

.register-header {
    text-align: center;
    margin-bottom: 28px;
}

.register-header .register-brand {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #2a6350;
    margin-bottom: 6px;
}

.register-header h1 {
    color: #2f6b52;
    font-size: 1.75em;
    margin-bottom: 8px;
    font-weight: 700;
}

.register-header p.register-tagline {
    color: #64748b;
    font-size: 0.95em;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-weight: 600;
}

.form-group label .required {
    color: #dc3545;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #2f6b52;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #64748b;
}

.username-check-group {
    display: flex;
    gap: 10px;
}

.username-check-group input {
    flex: 1;
}

.check-btn {
    padding: 12px 18px;
    background: #f1f5f4;
    border: 2px solid #c5d4c8;
    border-radius: 10px;
    color: #2f6b52;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.check-btn:hover {
    background: #e8f0ec;
    border-color: #2f6b52;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2f6b52 0%, #1a5f4a 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
    box-shadow: 0 4px 14px rgba(47, 107, 82, 0.35);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(47, 107, 82, 0.45);
}

.btn-submit:active {
    transform: translateY(0);
}

.message {
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.login-link {
    text-align: center;
    margin-top: 22px;
    color: #64748b;
    font-size: 0.95em;
}

.login-link a {
    color: #2f6b52;
    text-decoration: none;
    font-weight: 600;
}

.login-link a:hover {
    text-decoration: underline;
}

.login-link a:focus-visible {
    outline: 2px solid #2f6b52;
    outline-offset: 2px;
    border-radius: 2px;
}

.toast-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 12px 24px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
    word-wrap: break-word;
}

.toast-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-error {
    background: #c62828;
    color: white;
}

.toast-warning {
    background: #f59e0b;
    color: #1e293b;
}

@media (max-width: 768px) {
    .toast-message {
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
        transform: translateX(0) translateY(-100px);
        font-size: 13px;
        padding: 10px 16px;
    }

    .toast-message.show {
        transform: translateX(0) translateY(0);
    }
}

@media (max-width: 480px) {
    .toast-message {
        font-size: 12px;
        padding: 8px 12px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .register-container {
        padding: 26px 18px;
    }

    .register-header h1 {
        font-size: 1.45em;
    }

    .username-check-group {
        flex-direction: column;
    }

    .check-btn {
        width: 100%;
    }
}
