/**
 * 武侠MUD注册页面样式 - 优化版
 */

@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
    --primary-red: #c41e3a;
    --primary-gold: #d4af37;
    --primary-dark: #1a1a2e;
    --secondary-dark: #16213e;
    --accent-purple: #6c5ce7;
    --accent-blue: #0984e3;
    --success-green: #00b894;
    --danger-red: #d63031;
    --warning-orange: #fdcb6e;
    --text-light: #dfe6e9;
    --text-muted: #b2bec3;
    --bg-dark: #0c0c0c;
    --bg-card: #1e1e1e;
    --bg-input: #2d2d2d;
    --border-color: #404040;
    --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.3);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.5);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    color: var(--text-light);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(196, 30, 58, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(108, 92, 231, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-gold);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    position: relative;
    z-index: 10;
}

.card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-red), var(--primary-gold), var(--accent-purple));
}

.header {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--primary-dark) 100%);
    padding: 50px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '🏮';
    position: absolute;
    top: -20px;
    left: -20px;
    font-size: 120px;
    opacity: 0.05;
    transform: rotate(-15deg);
}

.header::after {
    content: '⚔️';
    position: absolute;
    bottom: -20px;
    right: -20px;
    font-size: 120px;
    opacity: 0.05;
    transform: rotate(15deg);
}

.header h1 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 3.5em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-gold), #f5d78c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    letter-spacing: 8px;
    position: relative;
    z-index: 2;
}

.header p {
    font-size: 1.2em;
    color: var(--text-muted);
    position: relative;
    z-index: 2;
    letter-spacing: 2px;
}

.main-content {
    padding: 40px;
}

.form-section {
    margin-bottom: 35px;
    position: relative;
}

.form-section::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
}

.form-section:last-of-type::after {
    display: none;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    gap: 15px;
}

.section-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-red), var(--primary-gold));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.section-title {
    flex: 1;
}

.section-title h2 {
    font-size: 1.5em;
    color: var(--text-light);
    font-weight: 600;
}

.section-title p {
    font-size: 0.9em;
    color: var(--text-muted);
    margin-top: 4px;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-light);
    font-size: 0.95em;
    letter-spacing: 0.5px;
}

.form-group label .required {
    color: var(--danger-red);
    margin-left: 5px;
    font-weight: 700;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    font-size: 1em;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-light);
    transition: var(--transition-normal);
    font-family: inherit;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1), var(--shadow-glow);
    background: #353535;
}

.form-control.error {
    border-color: var(--danger-red);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.form-control.success {
    border-color: var(--success-green);
}

.field-wrapper {
    position: relative;
}

.field-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    opacity: 0.5;
    pointer-events: none;
}

.error-message {
    color: var(--danger-red);
    font-size: 0.875em;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.help-text {
    color: var(--text-muted);
    font-size: 0.85em;
    margin-top: 8px;
    line-height: 1.6;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.gender-options {
    display: flex;
    gap: 15px;
}

.gender-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-normal);
    gap: 8px;
}

.gender-option:hover {
    border-color: var(--primary-gold);
    background: #353535;
}

.gender-option input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
}

.gender-option input[type="radio"]:checked {
    border-color: var(--primary-gold);
}

.gender-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--primary-gold);
    border-radius: 50%;
}

.gender-option:has(input[type="radio"]:checked) {
    border-color: var(--primary-gold);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), transparent);
}

.gender-option span {
    font-size: 1.1em;
}

.password-strength {
    margin-top: 15px;
}

.strength-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.strength-indicator {
    height: 100%;
    width: 0%;
    transition: all 0.4s ease;
    border-radius: 4px;
}

.strength-indicator.weak {
    width: 33%;
    background: linear-gradient(90deg, var(--danger-red), #ff7675);
}

.strength-indicator.medium {
    width: 66%;
    background: linear-gradient(90deg, var(--warning-orange), #ffeaa7);
}

.strength-indicator.strong {
    width: 100%;
    background: linear-gradient(90deg, var(--success-green), #81ecec);
}

.strength-text {
    font-size: 0.85em;
    margin-top: 8px;
    color: var(--text-muted);
}

.toggle-section {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1), rgba(212, 175, 55, 0.05));
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.toggle-section label {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
    gap: 15px;
}

.toggle-switch {
    position: relative;
    width: 58px;
    height: 30px;
    flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-red));
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(28px);
}

.custom-attributes {
    display: none;
    animation: slideDown 0.4s ease;
}

.custom-attributes.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.points-summary {
    background: var(--bg-input);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.points-summary .points-label {
    font-size: 0.95em;
    color: var(--text-muted);
}

.points-summary .points-display {
    font-size: 1.8em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-gold), #f5d78c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.points-summary .points-display.warning {
    background: linear-gradient(135deg, var(--danger-red), #ff7675);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.attribute-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.attribute-item {
    background: var(--bg-input);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: var(--transition-normal);
}

.attribute-item:hover {
    border-color: var(--primary-gold);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.15);
}

.attribute-item label {
    display: block;
    font-size: 0.95em;
    margin-bottom: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.attribute-item small {
    display: block;
    color: var(--text-muted);
    font-size: 0.8em;
    margin-top: 4px;
}

.attribute-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.attribute-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-red));
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.attribute-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.attribute-btn:active {
    transform: scale(0.95);
}

.attribute-item input[type="number"] {
    flex: 1;
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
    padding: 8px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--primary-gold);
    -moz-appearance: textfield;
}

.attribute-item input[type="number"]::-webkit-outer-spin-button,
.attribute-item input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.attribute-slider {
    width: 100%;
    margin-top: 12px;
    height: 6px;
    -webkit-appearance: none;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
}

.attribute-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-red));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.4);
    transition: var(--transition-fast);
}

.attribute-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.attribute-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-red));
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.4);
}

.attributes-help {
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.05), rgba(9, 132, 227, 0.05));
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.attributes-help h4 {
    color: var(--primary-gold);
    margin-bottom: 15px;
    font-size: 1.05em;
}

.attributes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.attribute-desc {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background: var(--bg-input);
    border-radius: 8px;
}

.attribute-desc .attr-icon {
    font-size: 1.3em;
    flex-shrink: 0;
}

.attribute-desc .attr-info {
    flex: 1;
}

.attribute-desc .attr-name {
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 3px;
}

.attribute-desc .attr-effect {
    font-size: 0.85em;
    color: var(--text-muted);
}

.agreement-section {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), rgba(196, 30, 58, 0.05));
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.agreement-section label {
    display: flex;
    align-items: flex-start;
    font-weight: normal;
    cursor: pointer;
    gap: 12px;
}

.agreement-section input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--primary-gold);
}

.agreement-section a {
    color: var(--primary-gold);
    text-decoration: none;
    transition: var(--transition-fast);
}

.agreement-section a:hover {
    text-decoration: underline;
    color: #f5d78c;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 45px;
    font-size: 1.15em;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-normal);
    font-family: inherit;
    letter-spacing: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-red), var(--primary-gold));
    color: white;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.6s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(196, 30, 58, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.alert {
    padding: 18px 22px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeIn 0.4s ease;
    font-size: 0.95em;
}

.alert-success {
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.2), rgba(0, 184, 148, 0.1));
    color: var(--success-green);
    border: 1px solid rgba(0, 184, 148, 0.3);
}

.alert-error {
    background: linear-gradient(135deg, rgba(214, 48, 49, 0.2), rgba(214, 48, 49, 0.1));
    color: var(--danger-red);
    border: 1px solid rgba(214, 48, 49, 0.3);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(253, 203, 110, 0.2), rgba(253, 203, 110, 0.1));
    color: var(--warning-orange);
    border: 1px solid rgba(253, 203, 110, 0.3);
}

.alert-info {
    background: linear-gradient(135deg, rgba(9, 132, 227, 0.2), rgba(9, 132, 227, 0.1));
    color: var(--accent-blue);
    border: 1px solid rgba(9, 132, 227, 0.3);
}

.footer {
    text-align: center;
    padding: 30px 40px;
    background: var(--primary-dark);
    border-top: 1px solid var(--border-color);
}

.footer p:first-child {
    font-size: 1em;
    margin-bottom: 12px;
}

.footer a {
    color: var(--primary-gold);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.footer a:hover {
    text-decoration: underline;
    color: #f5d78c;
}

.footer .copyright {
    font-size: 0.9em;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .container {
        margin: 20px auto;
        padding: 15px;
    }

    .header {
        padding: 40px 25px;
    }

    .header h1 {
        font-size: 2.5em;
        letter-spacing: 4px;
    }

    .main-content {
        padding: 25px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .gender-options {
        flex-direction: column;
    }

    .attribute-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        text-align: center;
    }

    .section-icon {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 10px auto;
        padding: 10px;
    }

    .header {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 2em;
        letter-spacing: 2px;
    }

    .main-content {
        padding: 20px;
    }

    .btn {
        padding: 15px 30px;
        font-size: 1em;
    }
}
