* {
    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(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 700px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    position: relative;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    border-radius: 50%;
}

.login-header h1 {
    font-size: 22px;
    color: #333;
    font-weight: 600;
}

.login-header p {
    font-size: 14px;
    color: #999;
    margin-top: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group .input-wrapper {
    position: relative;
}

.form-group .input-wrapper .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    height: 46px;
    padding: 0 16px 0 42px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
    outline: none;
    background: #fafafa;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="text"]::placeholder,
.form-group input[type="password"]::placeholder {
    color: #bbb;
}

.form-group .error-msg {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.form-group .error-msg.show {
    display: block;
}

.login-btn {
    width: 100%;
    height: 46px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(102, 126, 234, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-btn .loading {
    display: none;
}

.login-btn.loading .btn-text {
    visibility: hidden;
}

.login-btn.loading .loading {
    display: inline-block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
    font-size: 13px;
}

.login-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.alert.show {
    display: block;
}

.alert-error {
    background: #fef0f0;
    color: #e74c3c;
    border: 1px solid #fde2e2;
}

.alert-success {
    background: #f0f9eb;
    color: #67c23a;
    border: 1px solid #e1f3d8;
}

.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 5px;
}

.role-badge.admin { background: #e6f7ff; color: #1890ff; }
.role-badge.md { background: #f6ffed; color: #52c41a; }
.role-badge.mch { background: #fff7e6; color: #fa8c16; }
.role-badge.supplier { background: #f9f0ff; color: #722ed1; }
.role-badge.bd_agent { background: #fff0f6; color: #eb2f96; }
.role-badge.front_agent { background: #e6fffb; color: #13c2c2; }
.role-badge.goods_agent { background: #fcf4e8; color: #d46b08; }
.role-badge.staff { background: #f0f5ff; color: #2f54eb; }
.role-badge.saas_staff { background: #fffbe6; color: #d48806; }

/* 角色选择页样式 */
.role-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.role-card {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.role-card:hover {
    border-color: #667eea;
    background: #f0f2ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.role-card .role-icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.role-card .role-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    display: block;
}

.role-card .role-desc {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    display: block;
}

.page-title {
    text-align: center;
    margin-bottom: 30px;
}

.page-title h1 {
    font-size: 24px;
    color: #333;
}

.page-title p {
    font-size: 14px;
    color: #999;
    margin-top: 8px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    text-decoration: underline;
}

.back-link .arrow {
    margin-right: 4px;
}
